April 23, 20196 yr Mainly targeted @Droidz but if anyone else has input, you're welcome to contribute. The state interface has BeforeStates and NextStates. My question is when do they run and does their "Need To Run" condition get checked? If you add the state into the list of before or after states are they in the main engine list of states or are they only considered if the state you added the before/afterstates to, is triggered?
April 23, 20196 yr Hello, like that (in simplified): bool RunState(State currentState) { if (currentState.NeedToRun) { foreach (var beforeState in currentState.BeforeStates) { RunState(beforeState); } currentState.Run(); foreach (var nextState in state.NextStates) { RunState(nextState); } return true; } return false; }
April 23, 20196 yr Author Ah okay, thanks. One more thing though does the RunState(beforeState); check the beforeStates NeedToRun or does it just run it anyway?
April 23, 20196 yr Author 7 minutes ago, Droidz said: Method check if needtorun return true (it is the method than I shared code) Oh yeah sorry lol. Thanks
April 24, 20196 yr Author 9 hours ago, Avvi said: I sort of talked about this in my post: Yeah I saw that, very useful. I was more wondering about the actual states interface implementation of Before/NextStates rather than the events though.
Create an account or sign in to comment