Files
GameJamDungeon/Zennysoft.Game.Ma.Implementation/Game/state/states/GameLogic.State.Playing.cs

38 lines
829 B
C#

using Chickensoft.Introspection;
namespace Zennysoft.Ma.Adapter;
public partial class GameLogic
{
public partial record State
{
[Meta]
public partial record Playing : State,
IGet<Input.AskForTeleport>,
IGet<Input.PauseGame>,
IGet<Input.GoToOverworld>
{
public Playing()
{
OnAttach(() =>
{
Output(new Output.StartGame());
Output(new Output.LoadMap());
});
}
public void OnEnded() => Input(new Input.GameOver());
public Transition On(in Input.AskForTeleport input) => To<AskForTeleport>();
public Transition On(in Input.PauseGame input) => To<Paused>();
public Transition On(in Input.GoToOverworld input)
{
Output(new Output.GoToOverworld());
return ToSelf();
}
}
}
}