Blender V2.61 - r43446
|
#include <SCA_PropertySensor.h>
Public Types | |
enum | KX_PROPSENSOR_TYPE { KX_PROPSENSOR_NODEF = 0, KX_PROPSENSOR_EQUAL, KX_PROPSENSOR_NOTEQUAL, KX_PROPSENSOR_INTERVAL, KX_PROPSENSOR_CHANGED, KX_PROPSENSOR_EXPRESSION, KX_PROPSENSOR_MAX } |
Public Member Functions | |
SCA_PropertySensor (class SCA_EventManager *eventmgr, SCA_IObject *gameobj, const STR_String &propname, const STR_String &propval, const STR_String &propmaxval, KX_PROPSENSOR_TYPE checktype) | |
virtual void | Delete () |
virtual | ~SCA_PropertySensor () |
virtual CValue * | GetReplica () |
virtual void | Init () |
void | PrecalculateRangeExpression () |
bool | CheckPropertyCondition () |
virtual bool | Evaluate () |
virtual bool | IsPositiveTrigger () |
virtual CValue * | FindIdentifier (const STR_String &identifiername) |
Public Attributes | |
const STR_String | S_KX_PROPSENSOR_EQ_STRING |
Definition at line 38 of file SCA_PropertySensor.h.
KX_PROPSENSOR_NODEF | |
KX_PROPSENSOR_EQUAL | |
KX_PROPSENSOR_NOTEQUAL | |
KX_PROPSENSOR_INTERVAL | |
KX_PROPSENSOR_CHANGED | |
KX_PROPSENSOR_EXPRESSION | |
KX_PROPSENSOR_MAX |
Definition at line 54 of file SCA_PropertySensor.h.
SCA_PropertySensor::SCA_PropertySensor | ( | class SCA_EventManager * | eventmgr, |
SCA_IObject * | gameobj, | ||
const STR_String & | propname, | ||
const STR_String & | propval, | ||
const STR_String & | propmaxval, | ||
KX_PROPSENSOR_TYPE | checktype | ||
) |
Definition at line 50 of file SCA_PropertySensor.cpp.
References CValue::FindIdentifier(), SCA_ILogicBrick::GetParent(), CValue::GetText(), Init(), CValue::IsError(), KX_PROPSENSOR_INTERVAL, PrecalculateRangeExpression(), and CValue::Release().
Referenced by GetReplica().
SCA_PropertySensor::~SCA_PropertySensor | ( | ) | [virtual] |
Definition at line 144 of file SCA_PropertySensor.cpp.
References NULL, and CExpression::Release().
bool SCA_PropertySensor::CheckPropertyCondition | ( | ) |
Definition at line 174 of file SCA_PropertySensor.cpp.
References CExpression::Calculate(), CValue::FindIdentifier(), SCA_ILogicBrick::GetParent(), CValue::GetText(), CValue::IsError(), KX_PROPSENSOR_CHANGED, KX_PROPSENSOR_EQUAL, KX_PROPSENSOR_EXPRESSION, KX_PROPSENSOR_INTERVAL, KX_PROPSENSOR_NOTEQUAL, NULL, STR_String::ReadPtr(), CValue::Release(), CBoolValue::sFalseString, CBoolValue::sTrueString, and STR_String::Upper().
Referenced by Evaluate().
void SCA_PropertySensor::Delete | ( | ) | [virtual] |
For property sensor, it is used to release the pre-calculated expression so that self references are removed before the sensor itself is released
Reimplemented from SCA_ILogicBrick.
Definition at line 104 of file SCA_PropertySensor.cpp.
References NULL, CExpression::Release(), and CValue::Release().
bool SCA_PropertySensor::Evaluate | ( | ) | [virtual] |
Implements SCA_ISensor.
Definition at line 159 of file SCA_PropertySensor.cpp.
References CheckPropertyCondition(), SCA_ISensor::m_level, and SCA_ISensor::m_reset.
CValue * SCA_PropertySensor::FindIdentifier | ( | const STR_String & | identifiername | ) | [virtual] |
Reimplemented from CValue.
Definition at line 308 of file SCA_PropertySensor.cpp.
References CValue::FindIdentifier(), and SCA_ILogicBrick::GetParent().
CValue * SCA_PropertySensor::GetReplica | ( | void | ) | [virtual] |
Implements SCA_ISensor.
Definition at line 114 of file SCA_PropertySensor.cpp.
References Init(), KX_PROPSENSOR_INTERVAL, NULL, PrecalculateRangeExpression(), SCA_ISensor::ProcessReplica(), and SCA_PropertySensor().
void SCA_PropertySensor::Init | ( | void | ) | [virtual] |
Reimplemented from SCA_ISensor.
Definition at line 81 of file SCA_PropertySensor.cpp.
References SCA_ISensor::m_invert, and SCA_ISensor::m_reset.
Referenced by GetReplica(), and SCA_PropertySensor().
bool SCA_PropertySensor::IsPositiveTrigger | ( | ) | [virtual] |
Reimplemented from SCA_ISensor.
Definition at line 133 of file SCA_PropertySensor.cpp.
References SCA_ISensor::m_invert.
void SCA_PropertySensor::PrecalculateRangeExpression | ( | ) |
Definition at line 88 of file SCA_PropertySensor.cpp.
References CValue::AddRef(), CParser::ProcessText(), and CParser::SetContext().
Referenced by GetReplica(), and SCA_PropertySensor().
Definition at line 64 of file SCA_PropertySensor.h.