using JoshHeaps.Net.Models;
namespace JoshHeaps.Net.Services.Interfaces;
///
/// Process-wide registry of in-memory games and their cleanup lifecycle. Shared by the HTTP
/// controller (human and single-computer games) and the self-play coordinator (CPU-vs-CPU and
/// auto-training games), so every game is reachable from one place for lookup and spectating.
///
public interface IGameStore
{
/// Add (or replace) a game in the registry.
void Add(GameState game);
/// Look a game up by id.
bool TryGet(Guid id, out GameState game);
/// Whether a game with this id is still in the registry.
bool Contains(Guid id);
/// Snapshot of all games currently in the registry.
IReadOnlyCollection All { get; }
///
/// Schedule removal of a game after , cancelling any prior schedule
/// for it. On removal the game's engines are disposed and any training accumulator freed.
///
void ScheduleRemove(Guid id, TimeSpan delay);
}