can capture and destroy ports

This commit is contained in:
evanpelle
2024-11-15 20:43:15 -08:00
committed by Evan
parent 530f2dc2df
commit d3d0651659
5 changed files with 40 additions and 18 deletions
+6 -1
View File
@@ -1,4 +1,4 @@
import { MutableUnit, Tile, TerraNullius, UnitType } from "./Game";
import { MutableUnit, Tile, TerraNullius, UnitType, Player } from "./Game";
import { GameImpl } from "./GameImpl";
import { PlayerImpl } from "./PlayerImpl";
import { TerraNulliusImpl } from "./TerraNulliusImpl";
@@ -37,6 +37,11 @@ export class UnitImpl implements MutableUnit {
return this._owner;
}
setOwner(newOwner: Player): void {
this._owner = newOwner as PlayerImpl
this.g.fireUnitUpdateEvent(this, this.tile())
}
delete(): void {
this._owner._units = this._owner._units.filter(b => b != this);
this._active = false;