mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-15 20:56:04 +00:00
feat: move warship (#196)
This commit is contained in:
@@ -238,6 +238,9 @@ export interface Unit {
|
||||
dstPort(): Unit; // Only for trade ships
|
||||
detonationDst(): TileRef; // Only for nukes
|
||||
|
||||
setMoveTarget(cell: TileRef): void;
|
||||
moveTarget(): TileRef | null;
|
||||
|
||||
// Mutations
|
||||
setTroops(troops: number): void;
|
||||
delete(displayerMessage?: boolean): void;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { MessageType, nukeTypes, UnitSpecificInfos } from "./Game";
|
||||
import { MessageType, UnitSpecificInfos } from "./Game";
|
||||
import { UnitUpdate } from "./GameUpdates";
|
||||
import { GameUpdateType } from "./GameUpdates";
|
||||
import { simpleHash, toInt, within, withinInt } from "../Util";
|
||||
@@ -14,6 +14,7 @@ export class UnitImpl implements Unit {
|
||||
private _lastTile: TileRef = null;
|
||||
// Currently only warship use it
|
||||
private _target: Unit = null;
|
||||
private _moveTarget: TileRef = null;
|
||||
|
||||
private _constructionType: UnitType = undefined;
|
||||
|
||||
@@ -184,4 +185,12 @@ export class UnitImpl implements Unit {
|
||||
setDstPort(dstPort: Unit): void {
|
||||
this._dstPort = dstPort;
|
||||
}
|
||||
|
||||
setMoveTarget(moveTarget: TileRef) {
|
||||
this._moveTarget = moveTarget;
|
||||
}
|
||||
|
||||
moveTarget(): TileRef | null {
|
||||
return this._moveTarget;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user