1
0
Fork 0
spacetac/src/scripts/game/Fleet.ts
Michaël Lemaire 66f86b4ddb Removed Ship.movement_cost, in favor of engine-defined AP cost
Ship movement and AP consumption is now handled by MoveAction
2015-01-29 01:00:00 +01:00

34 lines
781 B
TypeScript

module SpaceTac.Game {
"use strict";
// A fleet of ships
export class Fleet {
// Fleet owner
player: Player;
// List of ships
ships: Ship[];
// Current battle in which the fleet is engaged (null if not fighting)
battle: Battle;
// Create a fleet, bound to a player
constructor(player: Player = null) {
this.player = player || new Player();
this.ships = [];
this.battle = null;
}
// Add a ship in this fleet
addShip(ship: Ship): void {
ship.fleet = this;
this.ships.push(ship);
}
// Set the current battle
setBattle(battle: Battle): void {
this.battle = battle;
}
}
}