Add minimap
This commit is contained in:
parent
fc9df09ee1
commit
73f5f45322
7 changed files with 184 additions and 122 deletions
|
|
@ -5,25 +5,25 @@ import { serializable } from '../../serialization/serializable';
|
|||
import { Command } from '../command';
|
||||
|
||||
@serializable
|
||||
export class OtherPlayerDirection {
|
||||
export class MinimapPlayer {
|
||||
public constructor(
|
||||
public readonly id: Id,
|
||||
public readonly direction: vec2,
|
||||
public readonly position: vec2,
|
||||
public readonly team: CharacterTeam,
|
||||
) {}
|
||||
|
||||
public toArray(): Array<any> {
|
||||
return [this.id, this.direction, this.team];
|
||||
return [this.id, this.position, this.team];
|
||||
}
|
||||
}
|
||||
|
||||
@serializable
|
||||
export class UpdateOtherPlayerDirections extends Command {
|
||||
public constructor(public readonly otherPlayerDirections: Array<OtherPlayerDirection>) {
|
||||
export class UpdateMinimap extends Command {
|
||||
public constructor(public readonly players: Array<MinimapPlayer>) {
|
||||
super();
|
||||
}
|
||||
|
||||
public toArray(): Array<any> {
|
||||
return [this.otherPlayerDirections];
|
||||
return [this.players];
|
||||
}
|
||||
}
|
||||
|
|
@ -7,10 +7,9 @@ export * from './commands/types/server-announcement';
|
|||
export * from './commands/types/property-updates-for-objects';
|
||||
export * from './commands/types/game-end';
|
||||
export * from './commands/types/game-start';
|
||||
export * from './commands/types/update-other-player-directions';
|
||||
export * from './commands/types/update-minimap';
|
||||
export * from './commands/types/update-game-state';
|
||||
export * from './commands/command-receiver';
|
||||
export * from './commands/types/update-other-player-directions';
|
||||
export * from './commands/command-executors';
|
||||
export * from './commands/command-generator';
|
||||
export * from './commands/types/actions/move-action';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue