feat(core): add IGameState, IEvents, WorldEvents with replay-on-subscribe
Adds WorldEntitySnapshot, IGameState, IEvents abstractions; WorldEvents implements replay-on-subscribe with per-handler exception swallowing; WorldGameState tracks entities; AppPluginHost exposes all three; stubs wired in Program.cs to keep build green ahead of Task 9 live wiring. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
22f684e8c6
commit
0c0c042dca
10 changed files with 212 additions and 3 deletions
14
src/AcDream.Core/Plugins/WorldGameState.cs
Normal file
14
src/AcDream.Core/Plugins/WorldGameState.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// src/AcDream.Core/Plugins/WorldGameState.cs
|
||||
using AcDream.Plugin.Abstractions;
|
||||
|
||||
namespace AcDream.Core.Plugins;
|
||||
|
||||
public sealed class WorldGameState : IGameState
|
||||
{
|
||||
private readonly List<WorldEntitySnapshot> _entities = new();
|
||||
|
||||
public IReadOnlyList<WorldEntitySnapshot> Entities => _entities;
|
||||
|
||||
/// <summary>Called by the host as each entity is hydrated.</summary>
|
||||
public void Add(WorldEntitySnapshot snapshot) => _entities.Add(snapshot);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue