1
0
Fork 0
spacetac/src/game/ai/Maneuver.ts

26 lines
724 B
TypeScript

module TS.SpaceTac.Game.AI {
// Ship maneuver for an artifical intelligence
// A maneuver is like a human player action, choosing an equipment and using it
export class Maneuver {
// Concerned ship
ship: Ship;
// Equipment to use
equipment: Equipment;
// Target for the action;
target: Target;
constructor(ship: Ship, equipment: Equipment, target: Target) {
this.ship = ship;
this.equipment = equipment;
this.target = target;
}
// Apply the maneuver in current battle
apply(): void {
this.equipment.action.apply(this.ship.getBattle(), this.ship, this.target);
}
}
}