コード例 #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();
	}
}
コード例 #2
0
ファイル: AttributeMatch.cpp プロジェクト: Arsakes/ember
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();
	}
}
コード例 #3
0
void OutfitMatch::testEntity(Eris::Entity* entity)
{
// 	if (entity) {
// 		mEntityObserver.release();
// 	}

	AbstractMatch<Cases::OutfitCase>::setEntity(entity);

	for (auto& aCase : mCases) {
		aCase->testMatch(entity);
	}
	evaluateChanges();

}