Initial commit
This commit is contained in:
commit
662f4a1d05
89 files changed
+8008
No files matched your search
@@ -0,0 +1,22 @@
|
||||
namespace Code.StateMachine
|
||||
{
|
||||
public abstract class BaseState<TEnum, TStateMachineContext>
|
||||
{
|
||||
public abstract TEnum myState { get; }
|
||||
|
||||
public delegate void Entered();
|
||||
public event Entered OnEntered;
|
||||
|
||||
public delegate void Exited();
|
||||
public event Exited OnExited;
|
||||
|
||||
protected BaseState(TStateMachineContext context)
|
||||
{
|
||||
Context = context;
|
||||
}
|
||||
public TStateMachineContext Context { get; protected set; }
|
||||
|
||||
public virtual void EnterState() => OnEntered?.Invoke();
|
||||
public virtual void ExitState() => OnExited?.Invoke();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user