Restructure loading of game
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using Chickensoft.Introspection;
|
||||
using Chickensoft.LogicBlocks;
|
||||
using Zennysoft.Game.Abstractions;
|
||||
|
||||
namespace Zennysoft.Ma.Adapter;
|
||||
|
||||
public partial class AppLogic
|
||||
{
|
||||
public partial record State
|
||||
{
|
||||
[Meta]
|
||||
public partial record EnemyViewer : State
|
||||
{
|
||||
public EnemyViewer()
|
||||
{
|
||||
|
||||
this.OnEnter(() =>
|
||||
{
|
||||
Output(new Output.EnemyViewerOpened());
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using Chickensoft.Introspection;
|
||||
|
||||
namespace Zennysoft.Ma.Adapter;
|
||||
|
||||
public partial class AppLogic
|
||||
{
|
||||
public partial record State
|
||||
{
|
||||
[Meta]
|
||||
public partial record MainMenu : State, IGet<Input.NewGame>, IGet<Input.EnemyViewerOpened>
|
||||
{
|
||||
public MainMenu()
|
||||
{
|
||||
}
|
||||
|
||||
public Transition On(in Input.NewGame input) => To<GameStarted>();
|
||||
public Transition On(in Input.EnemyViewerOpened input) => To<EnemyViewer>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user