The HBhvAction class encapsulates an animation action. More...

#include <HBhvSensor.h>

Public Member Functions

void DoAction ()
 
 HBhvAction (const char *target, const char *type, const char *value, HBhvSensor *sensor)
 
void Serialize (HUtilityXMLGenerator *xmlgen)
 
void SetTargetByPath (const char *targetpath)
 
virtual ~HBhvAction ()
 

Static Public Member Functions

static void * XMLCallback (HUtilityXMLTag *xt, bool open, void *m_pExtraData)
 

Protected Attributes

HBhvSensorm_pSensor
 
HBhvTargetObjectm_pTarget
 
char m_Type [256]
 
char m_Value [MVO_BUFFER_SIZE]
 

Detailed Description

The HBhvAction class encapsulates an animation action.

An action is executed based on the status of all conditions of the sensor it belongs to. Certain action types are directly related to specific target types. The following is a list of action types and targets.

Action Type: DOACTION
Associate Target Type: None
Action: Triggers a sensor action event.

Action Type: LOADFILE
Associate Target Type: None
Action: Load a file with the path indicated the value paramater.

Action Type: ACTIVATE
Associated Target Type: Animation
Action: Activate the target animation and then schedules it for execution. A delay before execution can be indicated by passing the number ticks to the value parameter in the constructor.

Action Type: CONTINUE
Associated Target Type: Animation
Action: Removes the target animation from the schedule animation list and then reschedules it for later.

Action Type: DEACTIVATE
Associated Target Type: Animation
Action: Removes the target animation from the schedule animation list and set its currently running flag to false.

Action Type: ACTIVATE
Associated Target Type: Sensor
Action: Activates the target sensor. A delay before execution can be indicated by passing the number ticks to the value parameter in the constructor.

Action Type: DEACTIVATE
Associated Target Type: Sensor
Action: Deactivates the target sensor.

Constructor & Destructor Documentation

◆ HBhvAction()

HBhvAction::HBhvAction ( const char *  target,
const char *  type,
const char *  value,
HBhvSensor sensor 
)

Constructs an HBhvAction object.

Parameters
targetThe descriptor for the target object for this action. You can use HBhvTargetObject::CreateTargetString() to generate this string.
typeThe action type which are described in the detailed description of this class.
valueAdditional data depending on the action type and target type.
sensorA pointer to the HBhvSensor object that this action belongs to.

◆ ~HBhvAction()

virtual HBhvAction::~HBhvAction ( )
virtual

Destructor for HBhvAction object.

Member Function Documentation

◆ DoAction()

void HBhvAction::DoAction ( )

Performs action based on the action type.

◆ Serialize()

void HBhvAction::Serialize ( HUtilityXMLGenerator *  xmlgen)

Writes XML data to a buffer.

◆ SetTargetByPath()

void HBhvAction::SetTargetByPath ( const char *  targetpath)

Sets target object for the action.

Parameters
targetThe descriptor for the target object for this action. You can use HBhvTargetObject::CreateTargetString() to generate this string.

◆ XMLCallback()

static void* HBhvAction::XMLCallback ( HUtilityXMLTag *  xt,
bool  open,
void *  m_pExtraData 
)
static

This is XML read callback which parses XML data and then populates the member variables with the associated values.

Member Data Documentation

◆ m_pSensor

HBhvSensor* HBhvAction::m_pSensor
protected

A pointer to the parent sensor.

◆ m_pTarget

HBhvTargetObject* HBhvAction::m_pTarget
protected

The action's target object.

◆ m_Type

char HBhvAction::m_Type[256]
protected

The action type.

◆ m_Value

char HBhvAction::m_Value[MVO_BUFFER_SIZE]
protected

The action value.


The documentation for this class was generated from the following file: