| 1 | #pragma once |
| 2 | |
| 3 | #include <basis/seadTypes.h> |
| 4 | |
| 5 | #include "Library/Nerve/Nerve.h" |
| 6 | #include "Library/Nerve/NerveStateBase.h" |
| 7 | |
| 8 | namespace al { |
| 9 | |
| 10 | class NerveStateCtrl { |
| 11 | public: |
| 12 | struct State { |
| 13 | NerveStateBase* state; |
| 14 | const Nerve* nerve; |
| 15 | const char* name; |
| 16 | }; |
| 17 | |
| 18 | NerveStateCtrl(s32 maxStates); |
| 19 | |
| 20 | void addState(NerveStateBase* state, const Nerve* nerve, const char* name); |
| 21 | bool updateCurrentState(); |
| 22 | void startState(const Nerve* nerve); |
| 23 | void update(); |
| 24 | |
| 25 | State* findStateInfo(const Nerve* nerve); |
| 26 | bool isCurrentStateEnd() const; |
| 27 | void tryEndCurrentState(); |
| 28 | |
| 29 | private: |
| 30 | s32 mMaxStates; |
| 31 | s32 mStateCount = 0; |
| 32 | State* mStates = nullptr; |
| 33 | State* mCurrentState = nullptr; |
| 34 | }; |
| 35 | } // namespace al |
| 36 | |