Class used to represent a simple action

Hierarchy (View Summary)

Constructors

Properties

Accessors

Methods

Constructors

  • Create a new instance of the simple action

    Parameters

    • alias: string

      Alias used to identify this action

    • name: string

      Name of this action

    Returns SimpleAction

Properties

_name: string

Name of this action

Accessors

  • get alias(): string
  • Get the alias used to identify this action

    Returns string

  • get needsObject(): boolean
  • Returns true if this action requires another GameObject to work, otherwise false.

    Returns boolean

Methods

  • Execute the action

    Parameters

    • alias: string

      Alias used to identify the kind of action

    • gameObjects: GameObject[]

      Array of game objects, where the first index is a reference to the game object on which the action should be executed.

    Returns undefined | ActionResult

    Result of the action or undefined if unhandled

  • Get the name of this action

    Returns string

  • Execute a simple action

    Parameters

    • alias: string

      Alias used to identify the kind of simple action

    • gameObject: GameObject

      Game object on which the simple action should be executed.

    Returns undefined | ActionResult

    Result of the simple action or undefined if unhandled

    Available as a static function so the BaseGameService can try to execute a simple action if an action class cannot be found for a given alias