Class EntityStateMachine

This is a state machine for an entity. The state machine manages a set of states, each of which has a set of component providers. When the state machine changes the state, it removes components associated with the previous state and adds components associated with the new state.

Hierarchy

  • EntityStateMachine

Constructors

Properties

entity: Entity

The entity whose state machine this is

Methods

  • Change to a new state. The components from the old state will be removed and the components for the new state will be added.

    Parameters

    • name: string

      The name of the state to change to.

    Returns void

  • Create a new state in this state machine.

    Parameters

    • name: string

      The name of the new state - used to identify it later in the changeState method call.

    Returns EntityState

    The new EntityState object that is the state. This will need to be configured with the appropriate component providers.

Generated using TypeDoc