1
0
Fork 0
spacetac/src/core/diffs/ShipDeathDiff.ts

24 lines
630 B
TypeScript

/// <reference path="BaseBattleDiff.ts"/>
module TK.SpaceTac {
/**
* A ship dies (or rather is put in emergency stasis mode)
*
* This typically happens when the ship's hull reaches 0.
* A dead ship cannot be interacted with.
*/
export class ShipDeathDiff extends BaseBattleShipDiff {
constructor(battle: Battle, ship: Ship) {
super(ship);
}
protected applyOnShip(ship: Ship, battle: Battle): void {
ship.alive = false;
}
protected revertOnShip(ship: Ship, battle: Battle): void {
ship.alive = true;
}
}
}