本文整理汇总了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;
}