Initial commit

This commit is contained in:
ThomasCharester committed 2025-12-12 23:11:01 +03:00
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;
}
}
}