Add minimap
This commit is contained in:
parent
fc9df09ee1
commit
73f5f45322
2 changed files with 184 additions and 122 deletions
29
shared/src/commands/types/update-minimap.ts
Normal file
29
shared/src/commands/types/update-minimap.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import { vec2 } from 'gl-matrix';
|
||||
import { Id } from '../../communication/id';
|
||||
import { CharacterTeam } from '../../objects/types/character-base';
|
||||
import { serializable } from '../../serialization/serializable';
|
||||
import { Command } from '../command';
|
||||
|
||||
@serializable
|
||||
export class MinimapPlayer {
|
||||
public constructor(
|
||||
public readonly id: Id,
|
||||
public readonly position: vec2,
|
||||
public readonly team: CharacterTeam,
|
||||
) {}
|
||||
|
||||
public toArray(): Array<any> {
|
||||
return [this.id, this.position, this.team];
|
||||
}
|
||||
}
|
||||
|
||||
@serializable
|
||||
export class UpdateMinimap extends Command {
|
||||
public constructor(public readonly players: Array<MinimapPlayer>) {
|
||||
super();
|
||||
}
|
||||
|
||||
public toArray(): Array<any> {
|
||||
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…
Reference in a new issue