2023-06-03 18:21:46 -07:00
|
|
|
namespace SupaLidlGame.State;
|
|
|
|
|
|
|
|
public interface IState<T> where T : IState<T>
|
2023-05-23 00:23:53 -07:00
|
|
|
{
|
2023-06-03 18:21:46 -07:00
|
|
|
/// <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);
|
2023-05-23 00:23:53 -07:00
|
|
|
|
2023-06-03 18:21:46 -07:00
|
|
|
/// <summary>
|
|
|
|
/// Called when the <c>Character</c> exits this <c>CharacterState</c>.
|
|
|
|
/// </summary>
|
|
|
|
public void Exit(IState<T> nextState);
|
2023-05-23 00:23:53 -07:00
|
|
|
|
2023-06-03 18:21:46 -07:00
|
|
|
public IState<T> Process(double delta) => null;
|
2023-05-23 00:23:53 -07:00
|
|
|
}
|