Replies: 1 comment 1 reply
-
@danneu Thanks for the kind words, I tweaked the types on the main line branch to type the data as you expect. dccb762 For a |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
(Btw, I love this game engine. Thanks for all the work.)
Reference: src/engine/Util/StateMachine.ts
consider this state machine:
Since neither
StateMachineDescription
norState
have any type parameters, they can't know theData
parameter of the StateMachine that they're used in.Instead I expected the types to be defined
StateMachineDescription<States, Data>
andState<Data>
which would have to matchStateMachine<States, Data>
so that you can write type-safe states.Aside, shouldn't there be a
stateMachine.start(data)
method to kick off the machine starting atstartingState
?Beta Was this translation helpful? Give feedback.
All reactions