@fboes/aerofly-custom-missions
Version:
Builder for Aerofly FS4 Custom Missions Files
29 lines (28 loc) • 846 B
JavaScript
/**
* @class
* A list of flight plans.
*
* The purpose of this class is to collect data needed for Aerofly FS4's
* `custom_missions_user.tmc` flight plan file format, and export the structure
* for this file via the `toString()` method.
*/
export class AeroflyMissionsList {
/**
* @param {AeroflyMission[]} missions in this mission list
*/
constructor(missions = []) {
this.missions = missions;
}
/**
* @returns {string} to use in Aerofly FS4's `custom_missions_user.tmc`
*/
toString() {
const separator = "\n// -----------------------------------------------------------------------------\n";
return `\
<[file][][]
<[tmmissions_list][][]
<[list_tmmission_definition][missions][]${separator + this.missions.join(separator) + separator} >
>
>`;
}
}