Restructure loading of game
This commit is contained in:
@@ -11,6 +11,7 @@ public partial class AppLogic
|
||||
public readonly record struct LoadGameFinished;
|
||||
|
||||
public readonly record struct FadeInFinished;
|
||||
|
||||
public readonly record struct FadeOutFinished;
|
||||
|
||||
public readonly record struct QuitGame;
|
||||
@@ -20,5 +21,9 @@ public partial class AppLogic
|
||||
public readonly record struct ShowLoadingScreen;
|
||||
|
||||
public readonly record struct SaveFileLoaded;
|
||||
|
||||
public readonly record struct EnemyViewerOpened;
|
||||
|
||||
public readonly record struct GalleryOpened;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,5 +29,9 @@ public partial class AppLogic
|
||||
public readonly record struct GameOver;
|
||||
|
||||
public readonly record struct StartLoadingSaveFile;
|
||||
|
||||
public readonly record struct EnemyViewerOpened;
|
||||
|
||||
public readonly record struct GalleryOpened;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,5 +9,5 @@ public interface IAppLogic : ILogicBlock<AppLogic.State>;
|
||||
[LogicBlock(typeof(State), Diagram = true)]
|
||||
public partial class AppLogic : LogicBlock<AppLogic.State>, IAppLogic
|
||||
{
|
||||
public override Transition GetInitialState() => To<State.GameStarted>();
|
||||
public override Transition GetInitialState() => To<State.MainMenu>();
|
||||
}
|
||||
|
||||
@@ -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