Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of PriorityTransitions #47

Open
ThomasReuss opened this issue May 28, 2024 · 0 comments
Open

Implementation of PriorityTransitions #47

ThomasReuss opened this issue May 28, 2024 · 0 comments

Comments

@ThomasReuss
Copy link

Dear maintainers,
while working through this repo, I came across the following questions / remarks:

  1. Why do we have both fsm and parentFSM and then we set parentFSM to be fsm? I do not see the added value of parentFsm in IStateMachine

  2. Say I have a class MyState which has a property Priority of type int, and I want to only transition between two states (esepcially in TriggerTransitionFromAny, TransitionFromAny, etc, when fromState.priority <= toState.Priority.
    The way I am currently implementing this is in a derived MyTransition class and a ShouldTransition override.
    Here we see a limitation of the expandability of the current base classes. IStateMachine has no GetState and no ActiveState. This forces me to pass in the StateMachine into the constructor of the transition.
    Are there any recommended ideas to implement this?

This is essentially a special case when the transition needs to know data from the states to decide whether it should allow a state change.
A similar "limitation" is that the StateBase.CanExit() does not know what state it was asked to exit to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant