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


C++ Datapad::updateWaypoint方法代码示例

本文整理汇总了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;
}
开发者ID:Rexz,项目名称:mmoserver,代码行数:47,代码来源:ArtisanManager.cpp


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