1
This commit is contained in:
@@ -29,6 +29,9 @@ namespace BITKit
|
||||
remove => stateMachine.OnStateChanged -= value;
|
||||
}
|
||||
|
||||
public event Action<T> OnStateRegistered;
|
||||
public event Action<T> OnStateUnRegistered;
|
||||
|
||||
public IDictionary<Type, T> StateDictionary => stateMachine.StateDictionary;
|
||||
|
||||
public virtual void Initialize()
|
||||
@@ -55,5 +58,17 @@ namespace BITKit
|
||||
{
|
||||
stateMachine.TransitionState(state);
|
||||
}
|
||||
|
||||
public virtual void Register(T newState) => StateMachineUtils.Register(this,newState);
|
||||
public virtual void UnRegister(T newState)=>StateMachineUtils.UnRegister(this,newState);
|
||||
void IStateMachine<T>.InvokeOnStateRegistered(T state)
|
||||
{
|
||||
OnStateRegistered?.Invoke(state);
|
||||
}
|
||||
|
||||
void IStateMachine<T>.InvokeOnStateUnRegistered(T state)
|
||||
{
|
||||
OnStateUnRegistered?.Invoke(state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user