void SCA_XNORController::Trigger(SCA_LogicManager* logicmgr) { bool sensorresult = true; for (std::vector<SCA_ISensor*>::const_iterator is=m_linkedsensors.begin(); !(is==m_linkedsensors.end());is++) { SCA_ISensor* sensor = *is; if (sensor->GetState()) { if (sensorresult == false) { sensorresult = true; break; } sensorresult = false; } } for (std::vector<SCA_IActuator*>::const_iterator i=m_linkedactuators.begin(); !(i==m_linkedactuators.end());i++) { SCA_IActuator* actua = *i; logicmgr->AddActiveActuator(actua,sensorresult); } }
CValue* SCA_ExpressionController::FindIdentifier(const STR_String& identifiername) { CValue* identifierval = NULL; for (vector<SCA_ISensor*>::const_iterator is=m_linkedsensors.begin(); !(is==m_linkedsensors.end());is++) { SCA_ISensor* sensor = *is; if (sensor->GetName() == identifiername) { identifierval = new CBoolValue(sensor->GetState()); //identifierval = sensor->AddRef(); } //if (!sensor->IsPositiveTrigger()) //{ // sensorresult = false; // break; //} } if (identifierval) return identifierval; return GetParent()->FindIdentifier(identifiername); }