1
0
Fork 0
spacetac/src/scripts/game/Fleet.ts

25 lines
501 B
TypeScript
Raw Normal View History

2014-12-29 00:00:00 +00:00
module SpaceTac.Game {
2015-01-07 00:00:00 +00:00
"use strict";
2014-12-29 00:00:00 +00:00
// A fleet of ships
export class Fleet {
// Fleet owner
player: Player;
// List of ships
ships: Ship[];
// Create a fleet, bound to a player
constructor(player: Player) {
this.player = player;
this.ships = [];
}
// Add a ship in this fleet
addShip(ship: Ship): void {
ship.fleet = this;
this.ships.push(ship);
2014-12-29 00:00:00 +00:00
}
}
2015-01-07 00:00:00 +00:00
}