1
0
Fork 0
spacetac/src/core/missions/MissionPart.ts

59 lines
1.2 KiB
TypeScript
Raw Normal View History

2017-09-24 22:23:22 +00:00
module TK.SpaceTac {
/**
* An abstract part of a mission, describing the goal
*/
export class MissionPart {
2017-06-29 17:25:38 +00:00
// Link to mission
mission: Mission
// Very short description
title: string
2017-06-29 17:25:38 +00:00
constructor(mission: Mission, title: string) {
this.mission = mission;
this.title = title;
}
2017-06-29 17:25:38 +00:00
get universe(): Universe {
return this.mission.universe;
}
get fleet(): Fleet {
return this.mission.fleet;
}
/**
* Abstract checking if the part is completed
*/
2017-06-29 17:25:38 +00:00
checkCompleted(): boolean {
return false;
}
2017-06-29 17:25:38 +00:00
/**
* Force the part as completed
*
* This is a cheat, and should enforce the part conditions
*/
forceComplete(): void {
}
2017-07-02 18:21:04 +00:00
2017-07-11 22:28:45 +00:00
/**
* Get a location hint about this part
*/
getLocationHint(): Star | StarLocation | null {
return null;
}
2017-07-02 18:21:04 +00:00
/**
* Event called when the part starts
*/
onStarted(): void {
}
/**
* Event called when the part ends
*/
onEnded(): void {
}
}
}