mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-10 07:44:36 +00:00
add port
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -38,7 +38,7 @@ export class Item {
|
||||
export const Items = {
|
||||
Nuke: new Item("Nuke", 1_000_000),
|
||||
Destroyer: new Item("Destroyer", 10),
|
||||
Port: new Item("Port", 10)
|
||||
Port: new Item("Port", 0)
|
||||
} as const;
|
||||
|
||||
export class Nation {
|
||||
|
||||
Reference in New Issue
Block a user