The HBhvCondition class is the base class for all condition types. More...

#include <HBhvSensor.h>

Public Member Functions

virtual void Evaluate (bool &and_flag, bool &or_flag)
 
virtual HBhvSensorGetSensor ()
 
 HBhvCondition (const char *target, const char *hevent, bool invert, HBhvSensor *sensor)
 
virtual void Register ()
 
virtual void Serialize (HUtilityXMLGenerator *xmlgen, HUtilityXMLTag *xmlt)
 
virtual void Serialize (HUtilityXMLGenerator *xmlgen)
 
virtual void SetTarget (const char *target)
 
virtual void UnRegister ()
 

Static Public Member Functions

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

Protected Attributes

bool m_bConditionMet
 
bool m_bInvert
 
char m_Event [256]
 
HBhvSensorm_pSensor
 
HBhvTargetObjectm_pTarget
 
char m_Value [256]
 

Detailed Description

The HBhvCondition class is the base class for all condition types.

Constructor & Destructor Documentation

◆ HBhvCondition()

HBhvCondition::HBhvCondition ( const char *  target,
const char *  hevent,
bool  invert,
HBhvSensor sensor 
)

Constructs an HBhvCondition object.

Parameters
targetThe segment path of the target for this condition.
heventThe event type.
invertPass true to invert the condition. In other words, this condition will return true if the condition evaluates to false and false if the condition evaluates to true.
sensorA pointer to the HBhvSensor object that this condition belongs to.

Member Function Documentation

◆ Evaluate()

virtual void HBhvCondition::Evaluate ( bool &  and_flag,
bool &  or_flag 
)
virtual

Evaluates the condition.

Parameters
and_flagResult of evaluation
or_flagResult of evaluation

Reimplemented in HBhvConditionSensorActive, and HBhvConditionAnimationRunning.

◆ GetSensor()

virtual HBhvSensor* HBhvCondition::GetSensor ( )
inlinevirtual
Returns
A pointer to the sensor object.

◆ Register()

virtual void HBhvCondition::Register ( )
inlinevirtual

Registers the condition with event manager (if applicable)

Reimplemented in HBhvConditionSensor, HBhvConditionAnimation, and HBhvConditionMouse.

◆ Serialize() [1/2]

virtual void HBhvCondition::Serialize ( HUtilityXMLGenerator *  xmlgen,
HUtilityXMLTag *  xmlt 
)
virtual

Writes XML data to a buffer.

◆ Serialize() [2/2]

virtual void HBhvCondition::Serialize ( HUtilityXMLGenerator *  xmlgen)
virtual

◆ SetTarget()

virtual void HBhvCondition::SetTarget ( const char *  target)
virtual

Sets a target for this condition.

Parameters
targetThe segment path of the targetfor this condition.

◆ UnRegister()

virtual void HBhvCondition::UnRegister ( )
inlinevirtual

Unregisters condition from event manager (if applicable)

Reimplemented in HBhvConditionONMOUSELEAVE, HBhvConditionONMOUSEENTER, HBhvConditionSensor, HBhvConditionAnimation, and HBhvConditionMouse.

◆ XMLCallback()

static void* HBhvCondition::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_bConditionMet

bool HBhvCondition::m_bConditionMet
protected

The value is true if the condition was met or false if the condition was not met.

◆ m_bInvert

bool HBhvCondition::m_bInvert
protected

The value is true if you want the condition inverted.

◆ m_Event

char HBhvCondition::m_Event[256]
protected

The event type.

◆ m_pSensor

HBhvSensor* HBhvCondition::m_pSensor
protected

The parent sensor.

◆ m_pTarget

HBhvTargetObject* HBhvCondition::m_pTarget
protected

A pointer to the target object.

◆ m_Value

char HBhvCondition::m_Value[256]
protected

Extra data for the conditon.


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