void OutfitMatch::testAttribute(const Atlas::Message::Element& attribute, bool triggerEvaluation) { if (attribute.isMap()) { Eris::Entity* entity(nullptr); const auto& tmap = attribute.asMap(); auto I = tmap.find(mOutfitName); std::string entityId; if (I != tmap.end() && Eris::Entity::extractEntityId(I->second, entityId)) { entity = mView->getEntity(entityId); //the entity might not be available yet, so we need to create an observer for it if (!entity) { if (mEntityObserver.get()) { mEntityObserver->observeCreation(mView, entityId); } } else { testEntity(entity); } } else { testEntity(entity); } } if (triggerEvaluation) { evaluateChanges(); } }
void AttributeMatch::testAttribute(const Atlas::Message::Element& attribute, bool triggerEvaluation) { for (std::vector<Cases::AttributeCase*>::iterator I = mCases.begin(); I != mCases.end(); ++I) { (*I)->testMatch(attribute); } if (triggerEvaluation) { evaluateChanges(); } }
void OutfitMatch::testEntity(Eris::Entity* entity) { // if (entity) { // mEntityObserver.release(); // } AbstractMatch<Cases::OutfitCase>::setEntity(entity); for (auto& aCase : mCases) { aCase->testMatch(entity); } evaluateChanges(); }