Esempio n. 1
0
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();
	}
}
Esempio n. 2
0
void EntityTypeMatch::setEntity(Eris::Entity* entity)
{
	AbstractMatch<Cases::EntityTypeCase>::setEntity( entity);
	testEntity(entity);
}