51 lines
1.7 KiB
C#
51 lines
1.7 KiB
C#
using OpenTK.Input;
|
|
|
|
namespace RecrownedGTK.Game {
|
|
public interface IState
|
|
{
|
|
/// <summary>
|
|
/// Called when this state is going to be shown.
|
|
/// </summary>
|
|
/// <param name="gameManager">The instance of the game manager that is requesting this.</param>
|
|
/// <returns>True of it's ready to be displayed, false otherwise.</returns>
|
|
bool Shown(GameEngine gameManager);
|
|
|
|
/// <summary>
|
|
/// Called on updating the state.
|
|
/// </summary>
|
|
/// <param name="time">The time that has passed since the last update in seconds.</param>
|
|
void Update(double time);
|
|
|
|
/// <summary>
|
|
/// Called for rendering things.
|
|
/// </summary>
|
|
/// <param name="time">The time that has elapsed since last rendering in seconds.</param>
|
|
void Render(double time);
|
|
|
|
/// <summary>
|
|
/// Called when this state is no longer being displayed.
|
|
/// </summary>
|
|
void Hidden();
|
|
|
|
/// <summary>
|
|
/// Called when the game window size is updated.
|
|
/// </summary>
|
|
/// <param name="width">The new width</param>
|
|
/// <param name="height">The new height</param>
|
|
void WindowSizeUpdate(int width, int height);
|
|
|
|
/// <summary>
|
|
/// When the game is being requested to be closed.
|
|
/// </summary>
|
|
/// <returns>True if closing is acceptable, or false otherwise.</returns>
|
|
bool CloseRequested();
|
|
|
|
/// <summary>
|
|
/// Called every update in the case that there should be a state change.
|
|
/// </summary>
|
|
/// <returns>Another state if ready to change states, or null if not.</returns>
|
|
IState ChangeState();
|
|
|
|
}
|
|
}
|