This commit is contained in:
evanpelle
2024-11-15 20:43:15 -08:00
committed by Evan
parent 4236a580e3
commit 09ead3791d
3 changed files with 107 additions and 45 deletions
+7 -1
View File
@@ -1,8 +1,10 @@
import { AllPlayers, Cell, Execution, MutableGame, MutablePlayer, PlayerID } from "../game/Game";
import { AllPlayers, Cell, Execution, MutableGame, MutablePlayer, PlayerID, UnitType } from "../game/Game";
export class PortExecution implements Execution {
private active = true
private mg: MutableGame
private player: MutablePlayer
constructor(
private _owner: PlayerID,
@@ -11,9 +13,13 @@ export class PortExecution implements Execution {
init(mg: MutableGame, ticks: number): void {
this.mg = mg
this.player = mg.player(this._owner)
}
tick(ticks: number): void {
this.player.addUnit(UnitType.Port, 0, this.mg.tile(this.cell))
this.active = false
}
owner(): MutablePlayer {