EngagementExtended

From Virtual World Web Wiki
Jump to: navigation, search

Represents an Enagement which is a state machine that helps to coordinate complex scripted activities that may include multiple players or bot avatars

  • This is a JavaScript visible object

Remarks [edit]

Properties

int ActorCount {get;}
Gets the number of actors in the engagement
bool AutoDestroy {get; set;}
True if the engagement should self-destroy when MinActors is reached or false if remaining actors should simply be removed.
bool Debug {get; set;}
Sets whether this engagement should spew debug messages into the log
int MinActors {get; set;}
Gets or sets the minimum number of actors required to keep the engagement alive. When the actor count falls below this value, if AutoDestroy is set, the engagement will shut down, otherwise the remaining actors will be ejected.

Methods

ActorExtended AddAvatar(AvatarExtended avatar, string state)
Adds any GameCloud avatar to an engagement. The appropriate Actor will be created for the type of avatar passed.
PlayerActorExtended AddParticipant(ParticipantExtended participant, string state)
Adds a participant's avatar to an engagement as a PlayerActor
void Clear()
Ejects all actors from the engagement and shuts it down if minimum actors are hit and AutoDestroy is set
EngagementStateExtended Configure(string stateName)
Creates or gets a named state in the state machine
void Destroy()
Destroys the engagement
PlayerActorExtended FindPlayerActor(ParticipantExtended participant)
Finds the actor for the specified participant
AvatarActorExtended FindPlayerActor(AvatarExtended avatar)
Finds the actor for the specified avatar
void FireForAll(string stateName)
Fires the specified trigger for all actors in the engagement
ActorExtended[] GetActors()
Gets all the actors in this engagement as an array
bool HasActor(ActorExtended actor)
Checks if this engagement contains the specified actor
bool HasAvatar(AvatarExtended avatar)
Checks if this engagement contains the specified avatar
bool HasParticipant(ParticipantExtended participant)
Checks if this engagement contains the specified avatar
void RemoveActor(ActorExtended actor)
Removes an actor from an engagement, destroying it
void RemoveAvatar(AvatarExtended avatar)
Removes a GameCloud avatar from an engagement, destroying it's actor
void RemoveParticipant(ParticipantExtended participant)
Removes a participant's avatar from an engagement, destroying it's actor
void Reset()
Ejects all actors from the engagement without shutting it down if minimum actors are hit