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 ()
HBhvBehaviorManagerGetBehaviorManager ()
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]

Detailed Description

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.

Constructor & Destructor Documentation

◆ HBhvSensor()

HBhvSensor::HBhvSensor ( const char *  name,
bool  active,
HBhvBehaviorManager BehaviorManager 

Constructs an HBhvSensor object.

nameThe name of the sensor.
activeThe activity state. Pass true if you want this sensor to be active by default.
BehaviorManagerA pointer to the HBhvBehaviorManager object.

Member Function Documentation

◆ Activate()

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.

delayThe delay time in ticks before activation.

◆ AddAction()

void HBhvSensor::AddAction ( HBhvAction action)

Adds a new item to the action list.

actionA pointer to the action object you want added.

◆ AddCondition()

void HBhvSensor::AddCondition ( HBhvCondition condition)

Adds a new condition to the condition list.

conditionA pointer to condition object to be added.

◆ DeActivate()

void HBhvSensor::DeActivate ( )

This method deactivates the sensor and unregisters all the items in the conditions array.

◆ Evaluate()

bool HBhvSensor::Evaluate ( )

Evaluates the sensor conditions. If the conditions are met, then the actions list is executed.

True if the conditions are met to true or false if conditions are not met.

◆ GetBehaviorManager()

HBhvBehaviorManager* HBhvSensor::GetBehaviorManager ( )
A pointer to HBhvBehaviorManager object

◆ GetCurrentlyActive()

bool HBhvSensor::GetCurrentlyActive ( )
True if the sensor is currently active or false if ensor is not currently active.

◆ GetDefaultActive()

bool HBhvSensor::GetDefaultActive ( )
True if the sensor is active by default or false if the sensor is inactive by default.

◆ GetName()

const char* HBhvSensor::GetName ( )
A pointer to the name of the sensor.

◆ Serialize()

void HBhvSensor::Serialize ( HUtilityXMLGenerator *  xmlgen)

Writes XML data to a buffer.

◆ Tick()

void HBhvSensor::Tick ( )

Performs any time based sensor action.

◆ XMLCallback()

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

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

Member Data Documentation

◆ m_ActionList

struct vlist_s* HBhvSensor::m_ActionList

The list of actions.

◆ m_bCurrentlyActive

bool HBhvSensor::m_bCurrentlyActive

The value is true if the sensor is currently active or false if the sensor not active.

◆ m_bDefaultActive

bool HBhvSensor::m_bDefaultActive

The value is true if the sensor is active by default, false if the sensor not active by default.

◆ m_ConditionList

struct vlist_s* HBhvSensor::m_ConditionList

The list of conditions.

◆ m_Delay

int HBhvSensor::m_Delay

The delay before the sensor activates.

◆ m_Name

char HBhvSensor::m_Name[256]

The sensor name

◆ m_pBehaviorManager

HBhvBehaviorManager* HBhvSensor::m_pBehaviorManager

A pointer to behaviour manager for this sensor.

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