mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-21 06:05:58 +00:00
can capture and destroy ports
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user