Files
GameJamDungeon/Zennysoft.Game.Ma.Implementation/App/State/States/AppLogic.State.SplashScreen.cs

34 lines
816 B
C#

namespace Zennysoft.Game.Ma.Implementation;
using Chickensoft.Introspection;
using Chickensoft.LogicBlocks;
using Zennysoft.Game.Abstractions;
public partial class AppLogic
{
public partial record State
{
[Meta]
public partial record SplashScreen : State, IGet<Input.FadeOutFinished>
{
public SplashScreen()
{
this.OnEnter(() => Output(new Output.ShowSplashScreen()));
OnAttach(
() => Get<IAppRepo>().SplashScreenSkipped += OnSplashScreenSkipped
);
OnDetach(
() => Get<IAppRepo>().SplashScreenSkipped -= OnSplashScreenSkipped
);
}
public Transition On(in Input.FadeOutFinished input) => To<MainMenu>();
public void OnSplashScreenSkipped() =>
Output(new Output.HideSplashScreen());
}
}
}