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


C++ ManagedReference::filterSchematicList方法代码示例

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


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

示例1: startSession

int CraftingSessionImplementation::startSession() {
	// crafter and craftingTool locked already in initializeSession
	ManagedReference<CraftingTool*> craftingTool = this->craftingTool.get();
	ManagedReference<CreatureObject*> crafter = this->crafter.get();
	ManagedReference<PlayerObject*> crafterGhost = this->crafterGhost.get();
	ManagedReference<CraftingStation*> craftingStation = this->craftingStation.get();

	if(crafter == NULL || craftingTool == NULL || crafterGhost == NULL) {
		cancelSession();
		return false;
	}

	/// Get current allowed complexity
	ManagedReference<PlayerObject*> playerObject = crafter->getPlayerObject();
	int complexityLevel = craftingTool->getComplexityLevel();

	if (craftingStation != NULL)
		complexityLevel = craftingStation->getComplexityLevel();

	/// Get filtered schematic list based on tool type and complexity
	currentSchematicList.removeAll();

	currentSchematicList =
			playerObject->filterSchematicList(crafter,
			craftingTool->getToolTabs(), complexityLevel);

	/// DPlay9 ***********************************
	PlayerObjectDeltaMessage9* dplay9 =
			new PlayerObjectDeltaMessage9(playerObject);
	dplay9->setExperimentationEnabled(craftingStation != NULL);
	dplay9->setCraftingState(1);

	if (craftingStation != NULL)
		dplay9->setClosestCraftingStation(craftingStation->getObjectID());
	else
		dplay9->setClosestCraftingStation(0);

	dplay9->setExperimentationPoints(experimentationPointsTotal);
	dplay9->close();
	crafter->sendMessage(dplay9);
	// End dplay9***********************************

	/// Object Controller Message 102 - Schematic List
	ObjectControllerMessage* ocm = new ObjectControllerMessage(
			crafter->getObjectID(), 0x0B, 0x102);

	ocm->insertLong(craftingTool->getObjectID());

	if (craftingStation != NULL)
		ocm->insertLong(craftingStation->getObjectID());
	else
		ocm->insertLong(0);

	ocm->insertInt(currentSchematicList.size());
	for (int i = 0; i < currentSchematicList.size(); ++i) {

		DraftSchematic* draftSchematic = currentSchematicList.get(i).get();

		ocm->insertInt(draftSchematic->getClientObjectCRC());
		ocm->insertInt(draftSchematic->getClientObjectCRC());
		ocm->insertInt(draftSchematic->getToolTab()); // this number decides what tab the schematic goes in (ex: 4 = food tab in crafting window)
	}
	crafter->sendMessage(ocm);
	/// ***********************************************

	/// Reset session state
	state = 1;

	if(crafterGhost != NULL && crafterGhost->getDebug()) {
		crafter->sendSystemMessage("*** Starting new crafting session ***");
	}

	return true;
}
开发者ID:Skyyyr,项目名称:GR-Core-TC1,代码行数:74,代码来源:CraftingSessionImplementation.cpp


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