Note: Not to be confust with FlxState or FlxSubState! State as in the design pattern! https://refactoring.guru/design-patterns/state

TODO: Generalize this a bit more to allow the UIState enum be defined with any enum

Constructor

new(?transitions:Map<UIState, Array<UIState>>)

Variables

@:value(Idle)read onlycurrentState:UIState = Idle

@:value(Idle)read onlypreviousState:UIState = Idle

Methods

is(state:UIState):Bool

onStateChanged(callback:(UIState, UIState) ‑> Void):Void

reset():Void

transition(newState:UIState):Bool