44 lines
1022 B
C#
44 lines
1022 B
C#
using Chickensoft.Introspection;
|
|
using Chickensoft.LogicBlocks;
|
|
using Zennysoft.Game.Abstractions;
|
|
|
|
namespace Zennysoft.Game.Ma.Implementation;
|
|
|
|
public partial class AppLogic
|
|
{
|
|
public partial record State
|
|
{
|
|
[Meta]
|
|
public partial record MainMenu : State, IGet<Input.NewGame>, IGet<Input.LoadGame>, IGet<Input.QuitGame>
|
|
{
|
|
public MainMenu()
|
|
{
|
|
this.OnEnter(() =>
|
|
{
|
|
Get<Data>().ShouldLoadExistingGame = false;
|
|
Output(new Output.SetupGameScene());
|
|
Get<IAppRepo>().OnMainMenuEntered();
|
|
Output(new Output.ShowMainMenu());
|
|
});
|
|
}
|
|
|
|
public Transition On(in Input.NewGame input)
|
|
{
|
|
return To<LeavingMenu>();
|
|
}
|
|
|
|
public Transition On(in Input.LoadGame input)
|
|
{
|
|
Get<Data>().ShouldLoadExistingGame = true;
|
|
return To<LeavingMenu>();
|
|
}
|
|
|
|
public Transition On(in Input.QuitGame input)
|
|
{
|
|
Output(new Output.ExitGame());
|
|
return ToSelf();
|
|
}
|
|
}
|
|
}
|
|
}
|