当前位置: 首页>>代码示例>>C++>>正文


C++ SharedTangibleObjectTemplate::getAppearanceFilename方法代码示例

本文整理汇总了C++中SharedTangibleObjectTemplate::getAppearanceFilename方法的典型用法代码示例。如果您正苦于以下问题:C++ SharedTangibleObjectTemplate::getAppearanceFilename方法的具体用法?C++ SharedTangibleObjectTemplate::getAppearanceFilename怎么用?C++ SharedTangibleObjectTemplate::getAppearanceFilename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SharedTangibleObjectTemplate的用法示例。


在下文中一共展示了SharedTangibleObjectTemplate::getAppearanceFilename方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: initialAssembly

void CraftingSessionImplementation::initialAssembly(int clientCounter) {
	ManagedReference<CraftingTool*> craftingTool = this->craftingTool.get();
	ManagedReference<CreatureObject*> crafter = this->crafter.get();
	ManagedReference<PlayerObject*> crafterGhost = this->crafterGhost.get();
	ManagedReference<CraftingStation*> craftingStation = this->craftingStation.get();
	ManagedReference<ManufactureSchematic*> manufactureSchematic = this->manufactureSchematic.get();
	ManagedReference<TangibleObject*> prototype = this->prototype.get();
	// Get the appropriate number of Experimentation points from Skill
	ManagedReference<DraftSchematic*> draftSchematic = manufactureSchematic->getDraftSchematic();

	// Set crafter
	manufactureSchematic->setCrafter(crafter);

	String expskill = draftSchematic->getExperimentationSkill();
	experimentationPointsTotal = int(crafter->getSkillMod(expskill) / 10);
	experimentationPointsUsed = 0;

	// Calculate exp failure for red bars
	int experimentalFailureRate = craftingManager.get()->calculateExperimentationFailureRate(crafter, manufactureSchematic, 0);

	// Get the level of customization
	String custskill = draftSchematic->getCustomizationSkill();
	int custpoints = int(crafter->getSkillMod(custskill));

	// Determine the outcome of the craft, Amazing through Critical
	assemblyResult = craftingManager.get()->calculateAssemblySuccess(crafter,
			draftSchematic, craftingTool->getEffectiveness());

	Locker locker(prototype);
	Locker schLock(manufactureSchematic);
	//Set initial crafting percentages
	craftingManager.get()->setInitialCraftingValues(prototype,manufactureSchematic,assemblyResult);
	//prototype->setInitialCraftingValues(manufactureSchematic, assemblyResult);

	Reference<CraftingValues*> craftingValues = manufactureSchematic->getCraftingValues();
	craftingValues->setManufactureSchematic(manufactureSchematic);
	craftingValues->setPlayer(crafter);

	// Flag to get the experimenting window
	if (craftingStation != NULL && (craftingValues->getVisibleExperimentalPropertyTitleSize() > 0 || manufactureSchematic->allowFactoryRun()))
		// Assemble with Experimenting
		state = 3;

	else
		// Assemble without Experimenting
		state = 4;

	// Start DPLAY9 ***********************************************************
	// Updates the stage of crafting, sets the number of experimentation points
	PlayerObjectDeltaMessage9* dplay9 = new PlayerObjectDeltaMessage9(crafter->getPlayerObject());
	dplay9->setCraftingState(state); // 3 If Experimenting is active, 4 if already experimented/ No experimenting
	dplay9->setExperimentationPoints(experimentationPointsTotal);
	dplay9->close();

	crafter->sendMessage(dplay9);
	// End DPLAY9 *************************************************************

	// Set Crafter name and generate serial number
	String name = crafter->getFirstName();
	prototype->setCraftersName(name);

	String serial = craftingManager.get()->generateSerial();
	prototype->setSerialNumber(serial);

	// Update the prototype with new values
	prototype->updateCraftingValues(craftingValues, true);

	addSkillMods();

	addWeaponDots();

	// Set default customization
	SharedTangibleObjectTemplate* templateData =
			cast<SharedTangibleObjectTemplate*>(prototype->getObjectTemplate());
	if (templateData == NULL) {
		error("No template for: " + String::valueOf(prototype->getServerObjectCRC()));
		return;
	}

	AssetCustomizationManagerTemplate::instance()->getCustomizationVariables(templateData->getAppearanceFilename().hashCode(), variables, true);

	for (int i = 0; i < variables.size(); ++i) {
		Reference<RangedIntCustomizationVariable*> var = cast<RangedIntCustomizationVariable*>(variables.get(i).get());
		if(var != NULL) {
			prototype->setCustomizationVariable(variables.elementAt(i).getKey(), var->getDefaultValue());
		}
	}

	prototype->setComplexity(manufactureSchematic->getComplexity());

	// Start DMSCO3 ***********************************************************
	// Sends the updated values to the crafting screen
	ManufactureSchematicObjectDeltaMessage3* dMsco3 =
			new ManufactureSchematicObjectDeltaMessage3(manufactureSchematic);
	dMsco3->updateCraftingValues(manufactureSchematic);
	dMsco3->updateComplexity(manufactureSchematic->getComplexity());

	dMsco3->close();

	crafter->sendMessage(dMsco3);
//.........这里部分代码省略.........
开发者ID:Skyyyr,项目名称:GR-Core-TC1,代码行数:101,代码来源:CraftingSessionImplementation.cpp


注:本文中的SharedTangibleObjectTemplate::getAppearanceFilename方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。