SupaLidlGame/State/IState.cs

27 lines
846 B
C#
Raw Normal View History

2023-05-23 00:23:53 -07:00
namespace SupaLidlGame.State
{
public interface IState<T> where T : IState<T>
{
/// <summary>
/// Called when this state is entered
/// </summary>
/// <remarks>
/// This returns a <c>IState</c> in case a state is being
/// transitioned to but wants to transition to another state. For
/// example, an attack state can return to an idle state, but that idle
/// state can override it to the move state immediately when necessary.
/// </remarks>
public IState<T> Enter(IState<T> previousState) => null;
/// <summary>
/// Called when the <c>Character</c> exits this <c>CharacterState</c>.
/// </summary>
public void Exit(IState<T> nextState)
{
}
public IState<T> Process(double delta) => null;
}
}