Class EntityState

Represents a state for an EntityStateMachine. The state contains any number of ComponentProviders which are used to add components to the entity when this state is entered.

Hierarchy

  • EntityState

Constructors

Methods

Constructors

Methods

  • Add a new ComponentMapping to this state. The mapping is a utility class that is used to map a component type to the provider that provides the component.

    Type Parameters

    • TComponent

    Parameters

    • type: Class<TComponent>

      The type of component to be mapped

    Returns StateComponentMapping<TComponent>

    The component mapping to use when setting the provider for the component

  • Get the ComponentProvider for a particular component type.

    Type Parameters

    • TComponent

    Parameters

    • type: Class<TComponent>

      The type of component to get the provider for

    Returns null | ComponentProvider<TComponent>

    The ComponentProvider

  • To determine whether this state has a provider for a specific component type.

    Type Parameters

    • TComponent

    Parameters

    • type: Class<TComponent>

      The type of component to look for a provider for

    Returns boolean

    true if there is a provider for the given type, false otherwise

Generated using TypeDoc