Stage

Stage

Abstract stages.

Constructor

new Stage($engine)

Description:
  • Creates a new stage.
Source:
Example
class StageExample extends Stage {}
Parameters:
Name Type Description
$engine Engine The engine on which to create the stage.

Members

actors :Array.<Actor>

Description:
  • Gets the current actors.
Source:
Gets the current actors.
Type:

engine :Engine

Description:
  • Gets the current engine.
Source:
Gets the current engine.
Type:

origin :Actor

Description:
  • Gets the 'origin' actor (not attached).
Source:
Gets the 'origin' actor (not attached).
Type:

pointOfView :Actor

Description:
  • Gets the point of view.
Source:
Gets the point of view.
Type:

uuid :string

Description:
  • Gets the uuid.
Source:
Gets the uuid.
Type:
  • string

Methods

createActor($actoropt) → {Actor.<TypeGenericAction, TypeGenericState>}

Description:
  • Creates the given actor.
Source:
Parameters:
Name Type Attributes Description
$actor Class.<Actor.<TypeGenericAction, TypeGenericState>> <optional>
The actor to create.
Returns:
Type
Actor.<TypeGenericAction, TypeGenericState>

getActorWithIdentifier($identifier) → {Actor}

Description:
  • Gets the first actor with the given identifier.
Source:
Parameters:
Name Type Description
$identifier string The identifier of the actor to get.
Returns:
Type
Actor

getActorsWithIdentifier($identifier) → {Array.<Actor>}

Description:
  • Gets the actors with the given identifier.
Source:
Parameters:
Name Type Description
$identifier string The identifier of the actors to get.
Returns:
Type
Array.<Actor>

hasActor($actor) → {boolean}

Description:
  • Checks if the stage has the given actor.
Source:
Parameters:
Name Type Description
$actor Actor The actor to check.
Returns:
Type
boolean

hasActorWithIdentifier($identifier) → {boolean}

Description:
  • Checks if the stage has an actor with the given identifier.
Source:
Parameters:
Name Type Description
$identifier string The identifier of the actor to check.
Returns:
Type
boolean

onCreate()

Description:
  • Called when the stage is being created.
Source:

removeActor($actor)

Description:
  • Removes the given actor.
Source:
Parameters:
Name Type Description
$actor Actor The actor to remove.

removeActorWithIdentifier($identifier)

Description:
  • Removes the first actor with the given identifier.
Source:
Parameters:
Name Type Description
$identifier string The identifier of the actor to remove.

removeActors($force)

Description:
  • Removes all actors.
Source:
Parameters:
Name Type Default Description
$force boolean false If the removal should also be applied to all actors created during this removal.

removeActorsWithIdentifier($identifier, $force)

Description:
  • Removes the actors with the given identifier.
Source:
Parameters:
Name Type Default Description
$identifier string The identifier of the actors to remove.
$force boolean false If the removal should also be applied to the actors with the given identifier created during this removal.

setPointOfView($actor)

Description:
  • Sets the given actor as the point of view.
Source:
Parameters:
Name Type Description
$actor Actor The actor to set as the point of view.