1
0
Fork 0
spacetac/src/scripts/view/battle/ShipCard.ts

26 lines
705 B
TypeScript
Raw Normal View History

module SpaceTac.View {
2015-01-07 00:00:00 +00:00
"use strict";
2014-12-31 00:00:00 +00:00
// Card to display detailed information about a ship
export class ShipCard extends Phaser.Sprite {
// Displayed ship
private ship: Game.Ship;
// Build an empty ship card
constructor(battleview: BattleView, x: number, y: number) {
2015-01-23 00:00:00 +00:00
super(battleview.game, x, y, "battle-ship-card");
2014-12-31 00:00:00 +00:00
this.ship = null;
this.visible = false;
battleview.ui.add(this);
}
// Set the currently displayed ship (null to hide)
setShip(ship: Game.Ship) {
this.ship = ship;
Animation.setVisibility(this.game, this, ship !== null, 200);
2014-12-31 00:00:00 +00:00
}
}
2015-01-07 00:00:00 +00:00
}