BITFALL/Assets/BITKit/Core/Interfaces/IStateMachine.cs

27 lines
752 B
C#

using System;
using System.Collections.Generic;
namespace BITKit.StateMachine
{
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<T> where T : IState
{
bool Enabled { get; set; }
T CurrentState { get; set; }
event Action<T,T> OnStateChanged;
IDictionary<Type, T> StateDictionary { get; }
void Initialize();
void UpdateState(float deltaTime);
void DisposeState();
void TransitionState<State>() where State : T;
void TransitionState(T state);
}
}