using Chickensoft.Introspection; namespace Zennysoft.Ma.Godot.Adapter; public partial class InGameUILogic { public partial record State { [Meta] public partial record InventoryOpen : Active, IGet { public InventoryOpen() { OnAttach(() => { var gameRepo = Get(); gameRepo.CloseInventoryEvent += OnCloseInventoryEvent; gameRepo.Pause(); Output(new Output.ShowInventory()); }); OnDetach(() => { var gameRepo = Get(); gameRepo.Resume(); gameRepo.CloseInventoryEvent -= OnCloseInventoryEvent; Output(new Output.HideInventory()); }); } private void OnCloseInventoryEvent() => Input(new Input.HideInventory()); public Transition On(in Input.HideInventory input) => To(); } } }