dtActors::TaskActorProxy Class Reference

This class is a proxy for the base task actor following the Delta3D game actor design philosophy. More...

#include <taskactor.h>

Inheritance diagram for dtActors::TaskActorProxy:

dtGame::GameActorProxy dtDAL::PhysicalActorProxy dtDAL::TransformableActorProxy dtDAL::ActorProxy dtActors::TaskActorGameEventProxy dtActors::TaskActorOrderedProxy dtActors::TaskActorRollupProxy

List of all members.

Public Member Functions

 TaskActorProxy ()
 Constructs the task actor proxy.
virtual void BuildPropertyMap ()
 Builds the property map for the task actor proxy.
virtual void BuildInvokables ()
 Registers any invokables used by the task actor proxy.
virtual bool IsPlaceable () const
 Task actors are global actors, so they are not placeable.
virtual bool RequestScoreChange (const TaskActorProxy &childTask, const TaskActorProxy &origTask)
 This method is called by a child task on its parent to request from its parent permission to change its score.
virtual void NotifyScoreChanged (const TaskActorProxy &childTask)
 Informs the parent of this task that the score was changed.
virtual void NotifyActorUpdate ()
 This method is called when a task property is changed.
const TaskActorProxyGetParentTask () const
 Gets a const pointer to the parent of this task.
TaskActorProxyGetParentTask ()
 Gets a pointer to the parent of this task.
void AddSubTask (TaskActorProxy &subTask)
 Adds a new sub task to this task.
void RemoveSubTask (const TaskActorProxy &subTask)
 Removes an existing task from this task's list of children.
void RemoveSubTask (const std::string &name)
 Removes an existing task from this task's list of children.
TaskActorProxyFindSubTask (const std::string &name)
 Searches this task's list of sub tasks for the specified child.
TaskActorProxyFindSubTask (const dtCore::UniqueId &id)
 Searches this task's list of sub tasks for the specified child.
const std::vector
< dtCore::RefPtr
< TaskActorProxy > > & 
GetAllSubTasks () const
 
Returns:
A const list of sub tasks owned by this task.

void GetAllSubTasks (std::vector< TaskActorProxy * > &toFill)
 Fills the specified vector with all of this task's direct children.
void GetAllSubTasks (std::vector< const TaskActorProxy * > &toFill) const
 Fills the specified vector with all of this task's direct children.
unsigned GetSubTaskCount () const
 Gets the number of sub tasks owned by this task.
void SetTopLevelTask (bool flag)
 This method exists for the property system.
bool IsTopLevelTask () const
 Gets whether or not this task is a top level task.
float GetPassingScore () const
 Wrapper for the actor method.
float GetScore () const
 Wrapper for the actor method.
virtual dtDAL::ActorProxyIconGetBillBoardIcon ()
 Gets the billboard used to represent static mesh if this proxy's render mode is RenderMode::DRAW_BILLBOARD_ICON.
virtual const
ActorProxy::RenderMode & 
GetRenderMode ()
 Gets the method by which this static mesh is rendered.

Protected Member Functions

void SetSubTaskGroup (const dtDAL::NamedGroupParameter &subTasks)
 Sets the group parameter to populate the list of subtasks.
dtCore::RefPtr
< dtDAL::NamedGroupParameter
GetSubTaskGroup () const
 
Returns:
a new NamedGroupParameter containing NamedActorParameters with the ids of all the subtask proxies.

virtual ~TaskActorProxy ()
 Destroys the task actor proxy.
virtual void CreateActor ()
 Called by the game manager during creation of the proxy.
virtual void OnEnteredWorld ()
 Called when the proxy has been added to the game manager.
void SetParentTaskProxy (TaskActorProxy *parent)
 Sets the parent task to this one.


Detailed Description

This class is a proxy for the base task actor following the Delta3D game actor design philosophy.

Constructor & Destructor Documentation

dtActors::TaskActorProxy::TaskActorProxy (  ) 

Constructs the task actor proxy.

dtActors::TaskActorProxy::~TaskActorProxy (  )  [protected, virtual]

Destroys the task actor proxy.


Member Function Documentation

void dtActors::TaskActorProxy::BuildPropertyMap (  )  [virtual]

Builds the property map for the task actor proxy.

These properties wrap the specified properties located in the task actor.

Reimplemented from dtGame::GameActorProxy.

Reimplemented in dtActors::TaskActorGameEventProxy, and dtActors::TaskActorOrderedProxy.

void dtActors::TaskActorProxy::BuildInvokables (  )  [virtual]

Registers any invokables used by the task actor proxy.

The invokables allow the task actor to hook into the game manager messages system.

Reimplemented from dtGame::GameActorProxy.

Reimplemented in dtActors::TaskActorGameEventProxy.

virtual bool dtActors::TaskActorProxy::IsPlaceable (  )  const [inline, virtual]

Task actors are global actors, so they are not placeable.

Reimplemented from dtDAL::TransformableActorProxy.

bool dtActors::TaskActorProxy::RequestScoreChange ( const TaskActorProxy childTask,
const TaskActorProxy origTask 
) [virtual]

This method is called by a child task on its parent to request from its parent permission to change its score.

This method allows the parent task control over whether or not its children may be changed. For example, the TaskActorOrdered task uses this to ensure that if a subtask or any of its children are not completed out of order.

Parameters:
childTask The child task in question.
origTask The tree node in the task list that first instigated the request.
Returns:
True if a score change is allowed, false otherwise.
Note:
This method is a recurive method does a bottom up traversal of the path from the root of the task tree to the leaf task that first called this method.
See also:
TaskActorOrdered

Reimplemented in dtActors::TaskActorOrderedProxy.

void dtActors::TaskActorProxy::NotifyScoreChanged ( const TaskActorProxy childTask  )  [virtual]

Informs the parent of this task that the score was changed.

This is useful for tasks whos score is dependent on the cummulative scores of its children.

Parameters:
childTask The child task that issued the score changed notify.
See also:
TaskActorRollup

Reimplemented in dtActors::TaskActorOrderedProxy, and dtActors::TaskActorRollupProxy.

void dtActors::TaskActorProxy::NotifyActorUpdate (  )  [virtual]

This method is called when a task property is changed.

Note:
For optimal performance, the individual task implementations should called this method only once if a group of properties changes in one tick.

Reimplemented from dtGame::GameActorProxy.

const TaskActorProxy* dtActors::TaskActorProxy::GetParentTask (  )  const [inline]

Gets a const pointer to the parent of this task.

Returns:
The parent task or NULL if this task is not a subtask of another.

TaskActorProxy* dtActors::TaskActorProxy::GetParentTask (  )  [inline]

Gets a pointer to the parent of this task.

Returns:
The parent task or NULL if this task is not a subtask of another.

void dtActors::TaskActorProxy::AddSubTask ( TaskActorProxy subTask  ) 

Adds a new sub task to this task.

If the subtask is already a subtask of a different parent, the subtask is reparented and its old parent task is notified.

Parameters:
subTask The task to add as a subtask to this one.

void dtActors::TaskActorProxy::RemoveSubTask ( const TaskActorProxy subTask  ) 

Removes an existing task from this task's list of children.

Parameters:
subTask The task to remove.

void dtActors::TaskActorProxy::RemoveSubTask ( const std::string &  name  ) 

Removes an existing task from this task's list of children.

Parameters:
name The name of the task to remove.

TaskActorProxy * dtActors::TaskActorProxy::FindSubTask ( const std::string &  name  ) 

Searches this task's list of sub tasks for the specified child.

Parameters:
name The name of the child task to find.
Returns:
The requested proxy or NULL if it could not be found.

TaskActorProxy * dtActors::TaskActorProxy::FindSubTask ( const dtCore::UniqueId id  ) 

Searches this task's list of sub tasks for the specified child.

Parameters:
id The unique id of the task to search for.
Returns:
The requested proxy or NULL if it could not be found.

const std::vector<dtCore::RefPtr<TaskActorProxy> >& dtActors::TaskActorProxy::GetAllSubTasks (  )  const [inline]

Returns:
A const list of sub tasks owned by this task.

void dtActors::TaskActorProxy::GetAllSubTasks ( std::vector< TaskActorProxy * > &  toFill  ) 

Fills the specified vector with all of this task's direct children.

void dtActors::TaskActorProxy::GetAllSubTasks ( std::vector< const TaskActorProxy * > &  toFill  )  const

Fills the specified vector with all of this task's direct children.

unsigned dtActors::TaskActorProxy::GetSubTaskCount (  )  const [inline]

Gets the number of sub tasks owned by this task.

Returns:
The number of sub tasks.

void dtActors::TaskActorProxy::SetTopLevelTask ( bool  flag  )  [inline]

This method exists for the property system.

Note, this method is a no-op. IsTopLevelTask() is set if this task is added as a child to another.

Parameters:
flag 

bool dtActors::TaskActorProxy::IsTopLevelTask (  )  const [inline]

Gets whether or not this task is a top level task.

A top level task is a task with no parent.

Returns:
True if this is a top level task (i.e. This task has no parent.)

float dtActors::TaskActorProxy::GetPassingScore (  )  const [inline]

Wrapper for the actor method.

float dtActors::TaskActorProxy::GetScore (  )  const [inline]

Wrapper for the actor method.

virtual dtDAL::ActorProxyIcon* dtActors::TaskActorProxy::GetBillBoardIcon (  )  [inline, virtual]

Gets the billboard used to represent static mesh if this proxy's render mode is RenderMode::DRAW_BILLBOARD_ICON.

Used by STAGE.

Returns:
billboard icon to use

Reimplemented from dtDAL::ActorProxy.

virtual const ActorProxy::RenderMode& dtActors::TaskActorProxy::GetRenderMode (  )  [inline, virtual]

Gets the method by which this static mesh is rendered.

This is used by STAGE.

Returns:
If there is no geometry currently assigned, this method will return RenderMode::DRAW_BILLBOARD_ICON. If there is geometry assigned to this static mesh, RenderMode::DRAW_ACTOR is returned.

Reimplemented from dtDAL::ActorProxy.

void dtActors::TaskActorProxy::SetSubTaskGroup ( const dtDAL::NamedGroupParameter subTasks  )  [protected]

Sets the group parameter to populate the list of subtasks.

Parameters:
subTasks the group of tasks. It should contain NamedActorParameters with the ids of all the subtask proxies.
See also:
dtDAL::NamedGroupParameter

dtDAL::NamedActorParameter

dtCore::RefPtr< dtDAL::NamedGroupParameter > dtActors::TaskActorProxy::GetSubTaskGroup (  )  const [protected]

Returns:
a new NamedGroupParameter containing NamedActorParameters with the ids of all the subtask proxies.

See also:
dtDAL::NamedGroupParameter

dtDAL::NamedActorParameter

void dtActors::TaskActorProxy::CreateActor (  )  [protected, virtual]

Called by the game manager during creation of the proxy.

This method creates a TaskActor and returns it.

Implements dtGame::GameActorProxy.

Reimplemented in dtActors::TaskActorGameEventProxy, dtActors::TaskActorOrderedProxy, and dtActors::TaskActorRollupProxy.

void dtActors::TaskActorProxy::OnEnteredWorld (  )  [protected, virtual]

Called when the proxy has been added to the game manager.

Reimplemented from dtGame::GameActorProxy.

Reimplemented in dtActors::TaskActorGameEventProxy.

void dtActors::TaskActorProxy::SetParentTaskProxy ( TaskActorProxy parent  )  [inline, protected]

Sets the parent task to this one.

Called when a subtask is added.

Parameters:
The parent task.


http://www.delta3d.org
2.0.0 generated 14 Feb 2008