mwg API
    Preparing search index...

    Class EntityRegistry<T>

    Assigns and looks up stable ids for live objects.

    Deliberately not an ECS: it holds no components and imposes no shape on T beyond being an object. A game that needs one still owns its own entity type; this only solves the "how do I name it" problem roguelike.Scheduler.toJSON/simulation.SimulationRuntime. snapshot already need an answer to.

    Type Parameters

    • T extends object
    Index
    • registers an entity, using a caller-supplied stable id when provided

      Parameters

      • entity: T
      • OptionalrequestedId: string

      Returns string

    • the reverse lookup - what a game passes as another API's actorId/id callback

      Parameters

      • entity: T

      Returns string | undefined