24 lines
658 B
C#
24 lines
658 B
C#
using System.Collections.Generic;
|
|
using BaseGames.Core.Events;
|
|
|
|
namespace BaseGames.Core
|
|
{
|
|
/// <summary>
|
|
/// 可插件化的游戏状态行为接口。
|
|
/// </summary>
|
|
public interface IGameState
|
|
{
|
|
GameStateId Id { get; }
|
|
|
|
/// <summary>合法的后继状态集合。GameStateMachine.TransitionTo() 据此校验。</summary>
|
|
IReadOnlyCollection<GameStateId> ValidNextStates { get; }
|
|
|
|
void OnEnter(GameStateId previousState);
|
|
void OnExit(GameStateId nextState);
|
|
|
|
/// <summary>每帧由 GameManager.Update() 调用(默认空实现)。</summary>
|
|
void Tick(float deltaTime);
|
|
}
|
|
|
|
}
|