Initial commit
This commit is contained in:
commit
662f4a1d05
89 files changed
+8008
No files matched your search
@@ -0,0 +1,44 @@
|
||||
|
||||
// <auto-generated/>
|
||||
using Code.StateMachine;
|
||||
|
||||
using Code.Debug.States;
|
||||
|
||||
using Code.Debug.States;
|
||||
|
||||
namespace Code.Debug
|
||||
{
|
||||
|
||||
public partial class DebugStateMachine : AbstractStateMachine<Code.Debug.DebugStates,Code.Debug.DebugStateMachineContext>
|
||||
{
|
||||
|
||||
public DebugStateMachine()
|
||||
{
|
||||
|
||||
|
||||
var stateFirstState = new FirstState(StateMachineContext);
|
||||
States.Add(stateFirstState.myState, stateFirstState);
|
||||
|
||||
var stateSecondState = new SecondState(StateMachineContext);
|
||||
States.Add(stateSecondState.myState, stateSecondState);
|
||||
|
||||
CurrentBaseState = States[default(Code.Debug.DebugStates)];
|
||||
}
|
||||
|
||||
protected override bool CheckTransitionAllowed(Code.Debug.DebugStates nextState) => AllowedStates.HasFlag(nextState);
|
||||
protected override void ResetAllowedTransitions() => AllowedStates = 0;
|
||||
}
|
||||
|
||||
public static class DebugStateMachineExtensions
|
||||
{
|
||||
public static AbstractStateMachine<Code.Debug.DebugStates, Code.Debug.DebugStateMachineContext> AllowStateTransition(
|
||||
this AbstractStateMachine<Code.Debug.DebugStates, Code.Debug.DebugStateMachineContext> stateMachine, Code.Debug.DebugStates state)
|
||||
{
|
||||
if (stateMachine == null) return null;
|
||||
|
||||
stateMachine.AllowedStates |= state;
|
||||
return stateMachine;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d33c2f17dfcae5e42bd7c3163ef31dc5
|
||||
Reference in new issue
Block a user