Add minimap
Some checks failed
Build & deploy / Build & publish server image (pull_request) Has been skipped
Build & deploy / Build & deploy website (pull_request) Failing after 52s

This commit is contained in:
Andras Schmelczer 2026-06-15 08:10:54 +01:00
commit 73f5f45322
2 changed files with 184 additions and 122 deletions

View 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];
}
}

View file

@ -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';