本文整理汇总了C++中Datapad::updateWaypoint方法的典型用法代码示例。如果您正苦于以下问题:C++ Datapad::updateWaypoint方法的具体用法?C++ Datapad::updateWaypoint怎么用?C++ Datapad::updateWaypoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Datapad
的用法示例。
在下文中一共展示了Datapad::updateWaypoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: surveyEvent
////=============================================================================
////
//// survey event
////
//
void ArtisanManager::surveyEvent(PlayerObject* player, CurrentResource* resource, SurveyTool* tool)
{
if(tool && resource && player->isConnected())
{
Datapad* datapad = player->getDataPad();
ResourceLocation highestDist = gMessageLib->sendSurveyMessage(tool->getInternalAttribute<uint16>("survey_range"),tool->getInternalAttribute<uint16>("survey_points"),resource,player);
// this is 0, if resource is not located
if(highestDist.position.y == 5.0)
{
std::string name("Resource Survey");
std::u16string name_u16(name.begin(), name.end());
std::shared_ptr<WaypointObject> waypoint = datapad->getWaypointByName(name_u16);
// remove the old one
if(waypoint)
{
datapad->updateWaypoint(waypoint->getId(), waypoint->getName(), glm::vec3(highestDist.position.x,0.0f,highestDist.position.z),
static_cast<uint16>(gWorldManager->getZoneId()), player->getId(), WAYPOINT_ACTIVE);
}
else
{
// create a new one
if(datapad->getCapacity())
{
gMessageLib->SendSystemMessage(::common::OutOfBand("survey", "survey_waypoint"), player);
//gMessageLib->sendSystemMessage(this,L"","survey","survey_waypoint");
}
//the datapad automatically checks if there is room and gives the relevant error message
std::string name("Resource Survey");
std::u16string name_u16(name.begin(), name.end());
datapad->requestNewWaypoint(name_u16, glm::vec3(highestDist.position.x,0.0f,highestDist.position.z),static_cast<uint16>(gWorldManager->getZoneId()),Waypoint_blue);
}
gMissionManager->checkSurveyMission(player,resource,highestDist);
}
}
player->getSampleData()->mPendingSurvey = false;
}