// src/AcDream.Core/Plugins/WorldGameState.cs using AcDream.Plugin.Abstractions; namespace AcDream.Core.Plugins; public sealed class WorldGameState : IGameState { private readonly List _entities = new(); public IReadOnlyList Entities => _entities; /// Called by the host as each entity is hydrated. public void Add(WorldEntitySnapshot snapshot) => _entities.Add(snapshot); /// /// Remove any snapshot with the given local Id. Used when the /// server re-sends CreateObject for an entity already known to /// acdream — the host deletes the old snapshot before adding the new /// one so plugins don't see stale duplicates. /// public void RemoveById(uint id) => _entities.RemoveAll(e => e.Id == id); }