missing files

This commit is contained in:
aqw42
2025-05-29 18:43:03 +02:00
parent 33c3cda890
commit 45036defcb
2 changed files with 44 additions and 0 deletions
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 28 KiB

+43
View File
@@ -0,0 +1,43 @@
import { Execution, Game, Player, PlayerID } from "../game/Game";
export class MarkIdleExecution implements Execution {
private player: Player;
private active: boolean = true;
constructor(
private playerID: PlayerID,
private isIdle: boolean,
) {}
init(mg: Game, ticks: number): void {
if (!mg.hasPlayer(this.playerID)) {
console.warn(
`MarkIdleExecution: player ${this.playerID} not found in game`,
);
this.active = false;
return;
}
this.player = mg.player(this.playerID);
if (!this.player) {
console.warn(
`MarkIdleExecution: failed to retrieve player ${this.playerID}`,
);
this.active = false;
return;
}
}
tick(ticks: number): void {
this.player.markIdle(this.isIdle);
this.active = false;
}
isActive(): boolean {
return this.active;
}
activeDuringSpawnPhase(): boolean {
return false;
}
}