dacha
    Preparing search index...

    Interface SystemAPIRegistry

    The APIs that systems share with the rest of the game. It is world.systemApi.

    A system registers an API object, and any code finds it by its class.

    const physics = this.world.systemApi.get(PhysicsAPI);
    
    Index
    • Returns the API of this class.

      Type Parameters

      • T

      Parameters

      • apiClass: Constructor<T>

      Returns T

      Error If no API of this class is registered. Use has for an API that may be missing.

    • Checks if an API of this class is registered.

      Type Parameters

      • T

      Parameters

      • apiClass: Constructor<T>

      Returns boolean

    • Adds an API. Its class becomes the key to find it.

      Type Parameters

      • T extends object

      Parameters

      • api: T

      Returns void

      Error If an API of the same class is already registered.

    • Removes the API of this class.

      Type Parameters

      • T

      Parameters

      • apiClass: Constructor<T>

      Returns void