Class StateSystemMapping<TSystem>

Type Parameters

Hierarchy

  • StateSystemMapping

Constructors

  • Used internally, the constructor creates a component mapping. The constructor creates a SystemSingletonProvider as the default mapping, which will be replaced by more specific mappings if other methods are called.

    Type Parameters

    Parameters

    • creatingState: EngineState

      The SystemState that the mapping will belong to

    • provider: SystemProvider<TSystem>

      The System type for the mapping

    Returns StateSystemMapping<TSystem>

Methods

  • Creates a mapping for the System type to a specific System instance. A SystemInstanceProvider is used for the mapping.

    Type Parameters

    Parameters

    • system: TNextSystem

      The System instance to use for the mapping

    Returns StateSystemMapping<TNextSystem>

    This StateSystemMapping, so more modifications can be applied

  • Creates a mapping for the System type to a method call. The method should return a System instance. A DynamicSystemProvider is used for the mapping.

    Type Parameters

    Parameters

    • method: (() => TNextSystem)

      The method to provide the System instance.

        • (): TNextSystem
        • Returns TNextSystem

    Returns StateSystemMapping<TNextSystem>

    This StateSystemMapping, so more modifications can be applied.

  • Maps through to the addProvider method of the SystemState that this mapping belongs to so that a fluent interface can be used when configuring entity states.

    Type Parameters

    Parameters

    • provider: SystemProvider<TNextSystem>

      The component provider to use.

    Returns StateSystemMapping<TNextSystem>

    This StateSystemMapping, so more modifications can be applied.

  • Creates a mapping for the System type to a single instance of the provided type. The instance is not created until it is first requested. The type should be the same as or extend the type for this mapping. A SystemSingletonProvider is used for the mapping.

    Type Parameters

    Parameters

    • type: Class<TNextSystem>

      The type of the single instance to be created. If omitted, the type of the mapping is used.

    Returns StateSystemMapping<TNextSystem>

    This StateSystemMapping, so more modifications can be applied

Generated using TypeDoc