25 lines
633 B
C#
25 lines
633 B
C#
using Chickensoft.Introspection;
|
|
using Zennysoft.Game.Abstractions;
|
|
|
|
namespace Zennysoft.Game.Ma.Implementation;
|
|
|
|
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());
|
|
}
|
|
}
|
|
}
|