34 lines
781 B
C#
34 lines
781 B
C#
namespace Zennysoft.Ma.Adapter;
|
|
|
|
using Chickensoft.Introspection;
|
|
using Zennysoft.Game.Abstractions;
|
|
|
|
public partial class GameLogic
|
|
{
|
|
public partial record State
|
|
{
|
|
[Meta]
|
|
public partial record MenuBackdrop : State, IGet<Input.StartGame>, IGet<Input.Initialize>
|
|
{
|
|
public MenuBackdrop()
|
|
{
|
|
OnAttach(() => Get<IAppRepo>().GameEntered += OnGameEntered);
|
|
OnDetach(() => Get<IAppRepo>().GameEntered -= OnGameEntered);
|
|
}
|
|
|
|
public void OnGameEntered() => Input(new Input.StartGame());
|
|
|
|
public Transition On(in Input.StartGame input)
|
|
{
|
|
Output(new Output.LoadMap());
|
|
return To<Playing>();
|
|
}
|
|
|
|
public Transition On(in Input.Initialize input)
|
|
{
|
|
return ToSelf();
|
|
}
|
|
}
|
|
}
|
|
}
|