本文整理汇总了C++中NFDataList::AddVector3方法的典型用法代码示例。如果您正苦于以下问题:C++ NFDataList::AddVector3方法的具体用法?C++ NFDataList::AddVector3怎么用?C++ NFDataList::AddVector3使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NFDataList
的用法示例。
在下文中一共展示了NFDataList::AddVector3方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnAckSearchOpponentProcess
void NFCGamePVPModule::OnAckSearchOpponentProcess(const NFSOCK nSockIndex, const int nMsgID, const char * msg, const uint32_t nLen)
{
CLIENT_MSG_PROCESS(nMsgID, msg, nLen, NFMsg::AckSearchOppnent);
if (!m_pKernelModule->ExistObject(nPlayerID))
{
return;
}
m_pKernelModule->SetPropertyObject(nPlayerID, NFrame::Player::OpponentFighting(), NFGUID());
m_pKernelModule->SetPropertyInt(nPlayerID, NFrame::Player::FightingStar(), 0);
m_pKernelModule->SetPropertyInt(nPlayerID, NFrame::Player::PVPType(), NFMsg::EPVPType::PVP_INDIVIDUAL);
m_pSceneProcessModule->RequestEnterScene(nPlayerID, xMsg.scene_id(), 0, NFDataList());
int nNoWSceneID = m_pKernelModule->GetPropertyInt(nPlayerID, NFrame::Player::SceneID());
int nGroupID = m_pKernelModule->GetPropertyInt(nPlayerID, NFrame::Player::GroupID());
if (nNoWSceneID != xMsg.scene_id())
{
return;
}
//process opponent data
ProcessOpponentData(nPlayerID, xMsg);
m_pGameServerNet_ServerModule->SendMsgToGate(NFMsg::EGMI_ACK_SEARCH_OPPNENT, std::string(msg, nLen), nPlayerID);
for (int i = 0; i < xMsg.title().building_size(); ++i)
{
const NFMsg::TileBuilding& xTileBuilding = xMsg.title().building().Get(i);
NFGUID xBuildingID = NFINetModule::PBToNF(xTileBuilding.guid());
NFVector3 vPos;
vPos.SetX(xTileBuilding.x());
vPos.SetY(xTileBuilding.y());
std::string strCnfID = xTileBuilding.configid();
NFDataList xDataArg;
xDataArg.AddString(NFrame::NPC::Position());
xDataArg.AddVector3(vPos);
xDataArg.AddString(NFrame::NPC::MasterID());
xDataArg.AddObject(NFINetModule::PBToNF(xMsg.opponent()));
xDataArg.AddString(NFrame::NPC::AIOwnerID());
xDataArg.AddObject(nPlayerID);
xDataArg.AddString(NFrame::NPC::NPCType());
xDataArg.AddInt(NFMsg::ENPCType::ENPCTYPE_TURRET);
m_pKernelModule->CreateObject(xBuildingID, nNoWSceneID, nGroupID, NFrame::NPC::ThisName(), strCnfID, xDataArg);
}
}
示例2: OnObjectMove
// 移动
void NFCPlayerLogic::OnObjectMove(const NFSOCK nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen)
{
NFGUID nPlayerID;
NFMsg::ReqAckPlayerMove xMsg;
if (!NFINetModule::ReceivePB(nMsgID, msg, nLen, xMsg, nPlayerID))
{
return;
}
float fMove = g_pKernelModule->GetPropertyInt(NFINetModule::PBToNF(xMsg.mover()), "MOVE_SPEED")/10000.0f;
NFDataList var;
var.AddObject(NFINetModule::PBToNF(xMsg.mover()));
var.AddFloat(fMove);
const NFMsg::Vector3 &pos = xMsg.target_pos(0);
var.AddVector3(NFVector3(pos.x(), pos.y(), pos.z()));
DoEvent(E_PlayerEvent_PlayerMove, var);
}