DCSOlympus/client/src/ToggleableFeature.ts
PeekabooSteam 1c1e60146d
Pax1601 main (#52)
* 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.
2023-02-25 18:03:03 +01:00

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();
}
}