SupaLidlGame/State/IState.cs

24 lines
818 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>
2023-05-25 15:28:33 -07:00
public IState<T> Enter(IState<T> previousState);
2023-05-23 00:23:53 -07:00
/// <summary>
/// Called when the <c>Character</c> exits this <c>CharacterState</c>.
/// </summary>
2023-05-25 15:28:33 -07:00
public void Exit(IState<T> nextState);
2023-05-23 00:23:53 -07:00
public IState<T> Process(double delta) => null;
}
}