Re-introduce prototype code

This commit is contained in:
2024-08-23 00:39:15 -07:00
parent 8b3d1bed8a
commit 2fb0c364ca
62 changed files with 1685 additions and 187 deletions

View File

@@ -0,0 +1,28 @@
using Chickensoft.Introspection;
using Chickensoft.LogicBlocks;
namespace GameJamDungeon
{
public partial class GameLogic
{
[Meta]
public abstract partial record State : StateLogic<State>
{
protected State()
{
OnAttach(() =>
{
var gameRepo = Get<IGameRepo>();
gameRepo.IsPaused.Sync += OnIsPaused;
});
OnDetach(() =>
{
var gameRepo = Get<IGameRepo>();
gameRepo.IsPaused.Sync -= OnIsPaused;
});
}
public void OnIsPaused(bool isPaused) => Output(new Output.SetPauseMode(isPaused));
}
}
}