mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
* GA initial data * First commit of crude functionality. * More AIC work so I don't lose it. (Best commit message ever.) * Restructured to use 'phrases'. * Set to a working state. * Committing so I don't lose work. * Added ai-formation feature swtich and UI kit stuff. * Added plane units to UI kit.
35 lines
510 B
TypeScript
35 lines
510 B
TypeScript
export abstract class ToggleableFeature {
|
|
|
|
#status:boolean = false;
|
|
|
|
|
|
constructor( defaultStatus:boolean ) {
|
|
|
|
this.#status = defaultStatus;
|
|
|
|
this.onStatusUpdate();
|
|
|
|
}
|
|
|
|
|
|
getStatus() : boolean {
|
|
return this.#status;
|
|
}
|
|
|
|
|
|
protected onStatusUpdate() {}
|
|
|
|
|
|
toggleStatus( force?:boolean ) : void {
|
|
|
|
if ( force ) {
|
|
this.#status = force;
|
|
} else {
|
|
this.#status = !this.#status;
|
|
}
|
|
|
|
this.onStatusUpdate();
|
|
|
|
}
|
|
|
|
} |