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
parent fc9df09ee1
commit 73f5f45322
7 changed files with 184 additions and 122 deletions

View file

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

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