#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 | |
HBhvSensor * | m_pSensor |
HBhvTargetObject * | m_pTarget |
char | m_Type [256] |
char | m_Value [MVO_BUFFER_SIZE] |
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.
HBhvAction::HBhvAction | ( | const char * | target, | |
const char * | type, | |||
const char * | value, | |||
HBhvSensor * | sensor | |||
) |
Constructs an HBhvAction object.
target | The descriptor for the target object for this action. You can use HBhvTargetObject::CreateTargetString() to generate this string. | |
type | The action type which are described in the detailed description of this class. | |
value | Additional data depending on the action type and target type. | |
sensor | A pointer to the HBhvSensor object that this action belongs to. |
virtual HBhvAction::~HBhvAction | ( | ) | [virtual] |
Destructor for HBhvAction object.
void HBhvAction::DoAction | ( | ) |
Performs action based on the action type.
void HBhvAction::Serialize | ( | HUtilityXMLGenerator * | xmlgen | ) |
Writes XML data to a buffer.
void HBhvAction::SetTargetByPath | ( | const char * | targetpath | ) |
Sets target object for the action.
target | The descriptor for the target object for this action. You can use HBhvTargetObject::CreateTargetString() to generate this string. |
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.
HBhvSensor* HBhvAction::m_pSensor [protected] |
A pointer to the parent sensor.
HBhvTargetObject* HBhvAction::m_pTarget [protected] |
The action's target object.
char HBhvAction::m_Type[256] [protected] |
The action type.
char HBhvAction::m_Value[MVO_BUFFER_SIZE] [protected] |
The action value.