本文整理汇总了C++中SharedObjectTemplate::getFullTemplateString方法的典型用法代码示例。如果您正苦于以下问题:C++ SharedObjectTemplate::getFullTemplateString方法的具体用法?C++ SharedObjectTemplate::getFullTemplateString怎么用?C++ SharedObjectTemplate::getFullTemplateString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharedObjectTemplate
的用法示例。
在下文中一共展示了SharedObjectTemplate::getFullTemplateString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getTemplateFile
String TemplateManager::getTemplateFile(uint32 key) {
SharedObjectTemplate* templateData = templateCRCMap->get(key);
if (templateData == NULL) {
String ascii = clientTemplateCRCMap->get(key);
if (ascii.isEmpty())
throw Exception("TemplateManager::getTemplateFile exception unknown template key 0x" + String::hexvalueOf((int)key));
else
return ascii;
}
return templateData->getFullTemplateString();
}
示例2: coord
Vector<WorldCoordinates>* PathFinderManager::findPathFromCellToDifferentCell(const WorldCoordinates& pointA, const WorldCoordinates& pointB) {
//info ("findPathFromCellToDifferentCell", true);
CellObject* ourCell = pointA.getCell();
CellObject* targetCell = pointB.getCell();
int ourCellID = ourCell->getCellNumber();
int targetCellID = targetCell->getCellNumber();
ManagedReference<BuildingObject*> building1 = cast<BuildingObject*>( ourCell->getParent().get().get());
ManagedReference<BuildingObject*> building2 = cast<BuildingObject*>( targetCell->getParent().get().get());
if (building1 != building2) // TODO: implement path finding between 2 buildings
return NULL;
SharedObjectTemplate* templateObject = building1->getObjectTemplate();
if (templateObject == NULL)
return NULL;
PortalLayout* portalLayout = templateObject->getPortalLayout();
if (portalLayout == NULL)
return NULL;
FloorMesh* floorMesh1 = portalLayout->getFloorMesh(ourCellID);
FloorMesh* floorMesh2 = portalLayout->getFloorMesh(targetCellID);
if (floorMesh2->getCellID() != targetCellID)
error("floorMes2 cellID != targetCellID");
//info("targetCellID:" + String::valueOf(targetCellID), true);
PathGraph* pathGraph1 = floorMesh1->getPathGraph();
PathGraph* pathGraph2 = floorMesh2->getPathGraph();
Vector<WorldCoordinates>* path = new Vector<WorldCoordinates>(5, 1);
path->add(pointA); // adding source
//PathNode* source = pathGraph1->findNearestNode(pointA.getPoint());
TriangleNode* nearestSourceNodeTriangle = CollisionManager::getTriangle(pointA.getPoint(), floorMesh1);
if (nearestSourceNodeTriangle == NULL) {
delete path;
return NULL;
}
PathNode* source = CollisionManager::findNearestPathNode(nearestSourceNodeTriangle, floorMesh1, pointB.getPoint());//targetPathGraph->findNearestNode(pointB.getPoint());
if (source == NULL) {
delete path;
return NULL;
}
//PathNode* target = pathGraph2->findNearestNode(pointB.getPoint());
TriangleNode* nearestTargetNodeTriangle = CollisionManager::getTriangle(pointB.getPoint(), floorMesh2);
if (nearestTargetNodeTriangle == NULL) {
delete path;
return NULL;
}
PathNode* target = CollisionManager::findNearestPathNode(nearestTargetNodeTriangle, floorMesh2, pointB.getPoint());//targetPathGraph->findNearestNode(pointB.getPoint());
if (target == NULL) {
delete path;
return NULL;
}
Vector<PathNode*>* nodes = portalLayout->getPath(source, target);
if (nodes == NULL) {
StringBuffer str;
str << "Could not find path from node: " << source->getID()
<< " to node: " << target->getID() << " in building: "
<< templateObject->getFullTemplateString();
log(str.toString());
delete path;
return NULL;
}
// FIXME (dannuic): Sometimes nodes only have one entry.... why?
if (nodes->size() == 1) {
error("Only one node");
delete path;
return NULL;
}
// path from our position to path node
Vector<Triangle*>* trianglePath = NULL;
int res = getFloorPath(pointA.getPoint(), nodes->get(1)->getPosition(), floorMesh1, trianglePath);
if (res != -1 && trianglePath != NULL)
addTriangleNodeEdges(pointA.getPoint(), nodes->get(1)->getPosition(), trianglePath, path, ourCell);
if (trianglePath != NULL) {
//.........这里部分代码省略.........