Files
GameJamDungeon/Zennysoft.Game.Ma.Implementation/Player/State/States/PlayerLogic.State.Disabled.cs
2025-03-09 12:24:30 -07:00

25 lines
621 B
C#

using Chickensoft.Introspection;
using Zennysoft.Game.Abstractions;
namespace Zennysoft.Ma.Adapter;
public partial class PlayerLogic
{
public abstract partial record State
{
[Meta, Id("player_logic_state_disabled")]
public partial record Disabled : State, IGet<Input.Enable>
{
public Disabled()
{
OnAttach(() => Get<IAppRepo>().GameEntered += OnGameEntered);
OnDetach(() => Get<IAppRepo>().GameEntered -= OnGameEntered);
}
public Transition On(in Input.Enable input) => To<Idle>();
public void OnGameEntered() => Input(new Input.Enable());
}
}
}