void EmberEntityActionCreator::createActions(EntityMapping::EntityMapping& modelMapping, Cases::CaseBase* aCase, Definitions::CaseDefinition& caseDefinition)
{
	Definitions::CaseDefinition::ActionStore::iterator endJ = caseDefinition.getActions().end();
	for (Definitions::CaseDefinition::ActionStore::iterator J = caseDefinition.getActions().begin(); J != endJ; ++J) {
		if (J->getType() == "display-part") {
			EmberEntityPartAction* action = new EmberEntityPartAction(mEntity, J->getValue());
			aCase->addAction(action);
		} else if (J->getType() == "display-model") {
			EmberEntityModelAction* action = new EmberEntityModelAction(mEntity, J->getValue(), mScene, modelMapping);
			aCase->addAction(action);
		} else if (J->getType() == "hide-model") {
			EmberEntityHideModelAction* action = new EmberEntityHideModelAction(mEntity);
			aCase->addAction(action);
		} else if (J->getType() == "display-label") {
			auto action = new Gui::LabelAction(mEntity);
			aCase->addAction(action);
		} else if (J->getType() == "display-ocean") {
			Environment::OceanAction* action = new Environment::OceanAction(mEntity);
			aCase->addAction(action);
		} else if (J->getType() == "enable-composition") {
			CompositionAction* action = new CompositionAction(mEntity, J->getValue());
			aCase->addAction(action);
		}
	}

}
示例#2
0
void EntityCreatorActionCreator::createActions(EntityMapping::EntityMapping& modelMapping, EntityMapping::Cases::CaseBase* aCase, EntityMapping::Definitions::CaseDefinition& caseDefinition)
{
	Definitions::CaseDefinition::ActionStore::iterator endJ = caseDefinition.getActions().end();
	for (Definitions::CaseDefinition::ActionStore::iterator J = caseDefinition.getActions().begin(); J != endJ; ++J) {
		if (J->getType() == "display-part") {
			EntityCreatorPartAction* action = new EntityCreatorPartAction(mCreationInstance, J->getValue());
			aCase->addAction(action);
		} else if (J->getType() == "display-model") {
			EntityCreatorModelAction* action = new EntityCreatorModelAction(mCreationInstance, J->getValue());
			aCase->addAction(action);
		} else if (J->getType() == "hide-model") {
			EntityCreatorHideModelAction* action = new EntityCreatorHideModelAction(mCreationInstance);
			aCase->addAction(action);
		}
	}
}