RAIN.Action.SequentialActionExecutor Class Reference

SequentialActionExecutor is a basic executor that executes contained Actions in sequence, waiting for each Action to complete successfully before beginning the next Action. More...

Inheritance diagram for RAIN.Action.SequentialActionExecutor:
RAIN.Action.Action RAIN.Action.IActionExecutor

List of all members.

Classes

class  TimeBundle

Public Member Functions

 SequentialActionExecutor ()
 Default constructor.
override ActionResult Start (Agent agent, float deltaTime)
 Implementation of Action.Start() Performs initialization.
override ActionResult Execute (Agent agent, float deltaTime)
 Implementation of Action.Execute() Each Action must complete with a result of SUCCESS before the next Action is started. If any Action fails, execution fails.
override Action.ActionResult Stop (Agent agent, float deltaTime)
 Implementation of Action.Stop() Performs cleanup.
void RemovePending (string actionName, bool removeAll)
 Remove any Actions matching actionName that have not yet started execution.
void RemoveCurrent (string actionName, bool removeAll)
 Remove any Actions matching actionName that are executing.
void RemoveCompleted (string actionName, bool removeAll)
 Remove any Actions matching actionName that have completed execution.
void Reset (Agent actor)
 Reset will clear all Actions and reset the ActionContext.
void Reset (Agent actor, ActionContext context)
 Reset will clear all Actions and set the ActionContext to the given context.
override void SetActionContext (ActionContext context)
 SetActionContext removes all completed Actions, sets the internal ActionContext, resets the ActionContext for any pending actions, then unpauses execution.
void AddAction (Action action, float delay)
 Add an action to the pending list of Actions to execute. A delay can be included specifying a time delay between activation/selection of an action and when it can be executed.
void InsertAction (Action action, int sequence)
 Insert an action at the specified position into the pending list of Actions to execute. A delay can be included specifying a time delay between activation/selection of an action and when it can be executed.
void RemoveAction (string actionName)
 Remove an action from the ActionExecutor. This will cause the Action to be Stopped and unloaded if it is currently executing.
void Pause ()
 Pause will pause execution until Unpause is called or the ActionContext is reset.
void Unpause (float delay)
 Unpause will cause execution to resume after a Pause call. Execution can be delayed by passing in a positive number value for delay.
void Clear ()
 Clear will reset to initial state, clearing all Actions from pending, current, and completed.

Detailed Description

SequentialActionExecutor is a basic executor that executes contained Actions in sequence, waiting for each Action to complete successfully before beginning the next Action.


Constructor & Destructor Documentation

RAIN.Action.SequentialActionExecutor.SequentialActionExecutor ( )

Default constructor.


Member Function Documentation

void RAIN.Action.SequentialActionExecutor.AddAction ( Action  action,
float  delay 
)

Add an action to the pending list of Actions to execute. A delay can be included specifying a time delay between activation/selection of an action and when it can be executed.

Parameters:
actionAn Action to add
delayA time delay in seconds to wait for before allowing execution of the Action

Implements RAIN.Action.IActionExecutor.

void RAIN.Action.SequentialActionExecutor.Clear ( )

Clear will reset to initial state, clearing all Actions from pending, current, and completed.

Implements RAIN.Action.IActionExecutor.

override ActionResult RAIN.Action.SequentialActionExecutor.Execute ( Agent  agent,
float  deltaTime 
) [virtual]

Implementation of Action.Execute() Each Action must complete with a result of SUCCESS before the next Action is started. If any Action fails, execution fails.

Parameters:
agentThe AI Agent owning this executor
deltaTimetimestep in seconds
Returns:
SUCCESS if all Actions completed successfully, FAILURE if any Actions failed, or RUNNING if more work should be done

Reimplemented from RAIN.Action.Action.

void RAIN.Action.SequentialActionExecutor.InsertAction ( Action  action,
int  sequence 
)

Insert an action at the specified position into the pending list of Actions to execute. A delay can be included specifying a time delay between activation/selection of an action and when it can be executed.

Parameters:
actionAn Action to insert
delayA time delay in seconds to wait for before allowing execution of the Action

Implements RAIN.Action.IActionExecutor.

void RAIN.Action.SequentialActionExecutor.Pause ( )

Pause will pause execution until Unpause is called or the ActionContext is reset.

Implements RAIN.Action.IActionExecutor.

void RAIN.Action.SequentialActionExecutor.RemoveAction ( string  actionName)

Remove an action from the ActionExecutor. This will cause the Action to be Stopped and unloaded if it is currently executing.

Parameters:
actionNameThe name of the Action to remove. If more than one Action is loaded with a matching name, all matches will be removed.

Implements RAIN.Action.IActionExecutor.

void RAIN.Action.SequentialActionExecutor.RemoveCompleted ( string  actionName,
bool  removeAll 
)

Remove any Actions matching actionName that have completed execution.

Parameters:
actionNameThe AI Agent owning this executor
removeAllIf true, remove all matching Actions, If false, remove only the first match
void RAIN.Action.SequentialActionExecutor.RemoveCurrent ( string  actionName,
bool  removeAll 
)

Remove any Actions matching actionName that are executing.

Parameters:
actionNameThe AI Agent owning this executor
removeAllIf true, remove all matching Actions, If false, remove only the first match
void RAIN.Action.SequentialActionExecutor.RemovePending ( string  actionName,
bool  removeAll 
)

Remove any Actions matching actionName that have not yet started execution.

Parameters:
actionNameThe AI Agent owning this executor
removeAllIf true, remove all matching Actions, If false, remove only the first match
void RAIN.Action.SequentialActionExecutor.Reset ( Agent  actor,
ActionContext  context 
)

Reset will clear all Actions and set the ActionContext to the given context.

Parameters:
actorThe AI Agent owning this executor
contextThe context to use after clearing Actions

Implements RAIN.Action.IActionExecutor.

void RAIN.Action.SequentialActionExecutor.Reset ( Agent  actor)

Reset will clear all Actions and reset the ActionContext.

Parameters:
actorThe AI Agent owning this executor

Implements RAIN.Action.IActionExecutor.

override void RAIN.Action.SequentialActionExecutor.SetActionContext ( ActionContext  context) [virtual]

SetActionContext removes all completed Actions, sets the internal ActionContext, resets the ActionContext for any pending actions, then unpauses execution.

Parameters:
contextThe ActionContext to set

Reimplemented from RAIN.Action.Action.

override ActionResult RAIN.Action.SequentialActionExecutor.Start ( Agent  agent,
float  deltaTime 
) [virtual]

Implementation of Action.Start() Performs initialization.

Parameters:
agentThe AI Agent owning this executor
deltaTimetimestep in seconds
Returns:
Returns SUCCESS or FAILURE

Reimplemented from RAIN.Action.Action.

override Action.ActionResult RAIN.Action.SequentialActionExecutor.Stop ( Agent  agent,
float  deltaTime 
) [virtual]

Implementation of Action.Stop() Performs cleanup.

Parameters:
agentThe AI Agent owning this executor
deltaTimetimestep in seconds
Returns:
Returns SUCCESS or FAILURE

Reimplemented from RAIN.Action.Action.

void RAIN.Action.SequentialActionExecutor.Unpause ( float  delay)

Unpause will cause execution to resume after a Pause call. Execution can be delayed by passing in a positive number value for delay.

Parameters:
delayThe amount of time to wait before resuming execution.

Implements RAIN.Action.IActionExecutor.