using System; using System.Collections.Generic; namespace BITKit.StateMachine { public struct EmptyState:IState { public bool Enabled { get; set; } public void Initialize() { } public void OnStateEntry(IState old) { } public void OnStateUpdate(float deltaTime) { } public void OnStateExit(IState old, IState newState) { } } public interface IState { bool Enabled { get; set; } void Initialize(); void OnStateEntry(IState old); void OnStateUpdate(float deltaTime); void OnStateExit(IState old, IState newState); } public interface IStateMachine where T : IState { bool Enabled { get; set; } T CurrentState { get; set; } event Action OnStateChanged; IDictionary StateDictionary { get; } void Initialize(); void UpdateState(float deltaTime); void DisposeState(); void TransitionState() where State : T; void TransitionState(T state); } }