The StateMachine maps different StateIdentifiers to indices to minimize the state space of the state (currentState and nextState). This index does not necessarily correspond to any meaningful number related to the identifier. Sometimes logic outside the state machine is interested in the state or next state, but there's not a reliable or easy way to map that.
Desired solution
Add an API to StateMachine that exposes the mapping from identifier to state index.
Motivation
The
StateMachine
maps differentStateIdentifier
s to indices to minimize the state space of the state (currentState
andnextState
). This index does not necessarily correspond to any meaningful number related to the identifier. Sometimes logic outside the state machine is interested in the state or next state, but there's not a reliable or easy way to map that.Desired solution
Add an API to
StateMachine
that exposes the mapping from identifier to state index.Alternatives considered
No response
Additional details
No response