The HBhvSensor class encapsulates an animation sensor. More...
#include <HBhvSensor.h>
Public Member Functions | |
void | Activate (int delay=0) |
void | AddAction (HBhvAction *action) |
void | AddCondition (HBhvCondition *condition) |
void | DeActivate () |
bool | Evaluate () |
HBhvBehaviorManager * | GetBehaviorManager () |
bool | GetCurrentlyActive () |
bool | GetDefaultActive () |
const char * | GetName () |
HBhvSensor (const char *name, bool active, HBhvBehaviorManager *BehaviorManager) | |
void | Serialize (HUtilityXMLGenerator *xmlgen) |
void | Tick () |
Static Public Member Functions | |
static void * | XMLCallback (HUtilityXMLTag *xt, bool open, void *m_pExtraData) |
Protected Attributes | |
struct vlist_s * | m_ActionList |
bool | m_bCurrentlyActive |
bool | m_bDefaultActive |
struct vlist_s * | m_ConditionList |
int | m_Delay |
char | m_Name [256] |
HBhvBehaviorManager * | m_pBehaviorManager |
The HBhvSensor class encapsulates an animation sensor.
A HBhvSensor objects holds a list of conditions which are usually related to an object in the segment hierachy and actions that should be performed based on whether these conditions are met.
HBhvSensor::HBhvSensor | ( | const char * | name, |
bool | active, | ||
HBhvBehaviorManager * | BehaviorManager | ||
) |
Constructs an HBhvSensor object.
name | The name of the sensor. |
active | The activity state. Pass true if you want this sensor to be active by default. |
BehaviorManager | A pointer to the HBhvBehaviorManager object. |
void HBhvSensor::Activate | ( | int | delay = 0 | ) |
This method activates the sensor. It fires the sensor activated event and registers the items in the conditions array.
delay | The delay time in ticks before activation. |
void HBhvSensor::AddAction | ( | HBhvAction * | action | ) |
Adds a new item to the action list.
action | A pointer to the action object you want added. |
void HBhvSensor::AddCondition | ( | HBhvCondition * | condition | ) |
Adds a new condition to the condition list.
condition | A pointer to condition object to be added. |
void HBhvSensor::DeActivate | ( | ) |
This method deactivates the sensor and unregisters all the items in the conditions array.
bool HBhvSensor::Evaluate | ( | ) |
Evaluates the sensor conditions. If the conditions are met, then the actions list is executed.
|
inline |
|
inline |
|
inline |
|
inline |
void HBhvSensor::Serialize | ( | HUtilityXMLGenerator * | xmlgen | ) |
Writes XML data to a buffer.
void HBhvSensor::Tick | ( | ) |
Performs any time based sensor action.
|
static |
This is XML read callback which parses XML data and then populates the member variables with the associated values.
|
protected |
The list of actions.
|
protected |
The value is true if the sensor is currently active or false if the sensor not active.
|
protected |
The value is true if the sensor is active by default, false if the sensor not active by default.
|
protected |
The list of conditions.
|
protected |
The delay before the sensor activates.
|
protected |
The sensor name
|
protected |
A pointer to behaviour manager for this sensor.