本文整理汇总了C++中NFDataList::Int方法的典型用法代码示例。如果您正苦于以下问题:C++ NFDataList::Int方法的具体用法?C++ NFDataList::Int怎么用?C++ NFDataList::Int使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NFDataList
的用法示例。
在下文中一共展示了NFDataList::Int方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Boost
int NFCSLGBuildingModule::Boost(const NFGUID& self, const NFGUID& xBuilID)
{
NF_SHARE_PTR<NFIRecord> pRecord = m_pKernelModule->FindRecord(self, "BuildingList");
if (NULL == pRecord.get())
{
m_pLogModule->LogNormal(NFILogModule::NLL_ERROR_NORMAL, self, "this is no [BuildingList] Record!", "", __FUNCTION__, __LINE__);
return 1;
}
NFDataList var;
pRecord->FindObject("BuildingGUID", xBuilID, var);
if (var.GetCount() <= 0)
{
m_pLogModule->LogNormal(NFILogModule::NLL_ERROR_NORMAL, self, "there are no the building", xBuilID.ToString(), __FUNCTION__, __LINE__);
return 1;
}
const int nRow = var.Int(0);
const int nBoostTime = 20;
const std::string strBuildID = pRecord->GetString(nRow, "BuildingID");
//NFDataList varHeart;
//varHeart << xBuilID;
m_pScheduleModule->AddSchedule(self, "OnBoostHeartBeat", this, &NFCSLGBuildingModule::OnBoostHeartBeat, /*varHeart,*/ nBoostTime, 1);
pRecord->SetInt(nRow, "State", NFMsg::EBS_BOOST);
pRecord->SetInt(nRow, "StateStartTime", pPluginManager->GetNowTime());
pRecord->SetInt(nRow, "StateEndTime", pPluginManager->GetNowTime() + nBoostTime);
return 0;
}
示例2: AddHeroExp
bool NFCHeroModule::AddHeroExp(const NFGUID& self, const NFGUID& xHeroID, const int64_t nExp)
{
NF_SHARE_PTR<NFIRecord> pHeroRecord = m_pKernelModule->FindRecord(self, NFrame::Player::PlayerHero::ThisName());
if (nullptr == pHeroRecord.get())
{
return false;
}
if (xHeroID.IsNull())
{
return false;
}
if (nExp <= 0)
{
return false;
}
int nRow = pHeroRecord->FindObject(NFrame::Player::PlayerHero::GUID, xHeroID);
if (nRow < 0)
{
return false;
}
NFDataList varRowData;
if (!pHeroRecord->QueryRow(nRow, varRowData))
{
return false;
}
const int64_t nCurExp = varRowData.Int(NFrame::Player::PlayerHero::Exp);
const int nBeforeLevel = varRowData.Int32(NFrame::Player::PlayerHero::Level);
int64_t nLeftExp = nCurExp + nExp;
int nAfterLevel = nBeforeLevel;
for (int i = nBeforeLevel; i < ECONSTDEFINE_HERO_MAXLEVEL; i++)
{
const int64_t nNeedExp = (i + 1) * ECONSTDEFINE_HERO_ONCELEVEEXP;
if (nLeftExp >= nNeedExp)
{
nAfterLevel += 1;
nLeftExp -= nNeedExp;
pHeroRecord->SetInt(nRow, NFrame::Player::PlayerHero::Level, nAfterLevel);
}
else
{
break;
}
}
pHeroRecord->SetInt(nRow, NFrame::Player::PlayerHero::Exp, nLeftExp);
return true;
}
示例3: FindRowByColValue
int NFCRecord::FindRowByColValue(const std::string & strColTag, const NFData & var)
{
NFDataList xDataList;
int nRowCount = FindRowByColValue(strColTag, var, xDataList);
if (nRowCount > 0 && xDataList.GetCount() > 0)
{
return (int) xDataList.Int(0);
}
return -1;
}
示例4:
int NFCRecord::FindVector3(const int nCol, const NFVector3 & value)
{
NFDataList xDataList;
int nRowCount = FindVector3(nCol, value, xDataList);
if (nRowCount > 0 && xDataList.GetCount() > 0)
{
return (int) xDataList.Int(0);
}
return -1;
}
示例5: FindString
int NFCRecord::FindString(const int nCol, const std::string & value)
{
NFDataList xDataList;
int nRowCount = FindString(nCol, value, xDataList);
if (nRowCount > 0 && xDataList.GetCount() > 0)
{
return (int) xDataList.Int(0);
}
return -1;
}
示例6: FindFloat
int NFCRecord::FindFloat(const int nCol, const double value)
{
NFDataList xDataList;
int nRowCount = FindFloat(nCol, value, xDataList);
if (nRowCount > 0 && xDataList.GetCount() > 0)
{
return (int) xDataList.Int(0);
}
return -1;
}
示例7: SendMsgToGame
bool NFCWorldNet_ServerModule::SendMsgToGame(const NFDataList& argObjectVar, const NFDataList& argGameID, const NFMsg::EGameMsgID eMsgID, google::protobuf::Message& xData)
{
if (argGameID.GetCount() != argObjectVar.GetCount())
{
return false;
}
for (int i = 0; i < argObjectVar.GetCount(); i++)
{
const NFGUID& identOther = argObjectVar.Object(i);
const int nGameID = (int) argGameID.Int(i);
SendMsgToGame(nGameID, eMsgID, xData, identOther);
}
return true;
}
示例8: Execute
bool NFCStateMachine::Execute()
{
//same for the current state
if (State_Error != meCurrentState)
{
if (mfHeartBeatTime > 0)
{
mfHeartBeatTime -= 0.001f;
}
else
{
NFIState* pState = GetState(meCurrentState);
pState->Execute(mOwnerID, this);
//设置心跳时间
NFDataList xDataList;
m_pKernelModule->Random(0, 10, 1, xDataList);
mfHeartBeatTime = pState->GetHeartBeatTime() + xDataList.Int(0);
}
}
return true;
}
示例9: Move
int NFCSLGBuildingModule::Move(const NFGUID& self, const NFGUID nGUID, const float fX, const float fY, const float fZ)
{
NF_SHARE_PTR<NFIRecord> pRecord = m_pKernelModule->FindRecord(self, "BuildingList");
if (NULL == pRecord.get())
{
m_pLogModule->LogNormal(NFILogModule::NLL_ERROR_NORMAL, self, "this is no [BuildingList] Record!", "", __FUNCTION__, __LINE__);
return 1;
}
NFDataList xMatchList;
int nMatchCount = pRecord->FindObject(BUILDING_GUID, nGUID, xMatchList);
if (nMatchCount != 1)
{
m_pLogModule->LogNormal(NFILogModule::NLL_ERROR_NORMAL, self, "[BuildingList] Record !", "", __FUNCTION__, __LINE__);
return 1;
}
int nMatchRow = xMatchList.Int(0);
pRecord->SetInt(nMatchRow, BUILDINNG_X, fX);
pRecord->SetInt(nMatchRow, BUILDINNG_Y, fY);
pRecord->SetInt(nMatchRow, BUILDINNG_Z, fZ);
return 0;
}
示例10: CalEquipGemProperty
bool NFCEquipPropertyModule::CalEquipGemProperty(const NFGUID& self, const NFGUID& xEquipGUID, NFDataList& xDataList)
{
NF_SHARE_PTR<NFIRecord> pBagRecord = m_pKernelModule->FindRecord(self, NFrame::Player::BagEquipList::ThisName());
if (nullptr == pBagRecord)
{
return false;
}
NF_SHARE_PTR<NFIRecord> pCommPropertyValueRecord = m_pKernelModule->FindRecord(self, NFrame::Player::CommValue::ThisName());
if (nullptr == pCommPropertyValueRecord)
{
return false;
}
NFDataList varFind;
if (pBagRecord->FindObject(NFrame::Player::BagEquipList::GUID, xEquipGUID, varFind) != 1)
{
return false;
}
const int nRow = varFind.Int32(0);
xDataList.Clear();
/////////////GemBase/////////////////////////////////////////
int nSlotCount = pBagRecord->GetInt32(nRow, NFrame::Player::BagEquipList::SlotCount);
if (nSlotCount <= 0)
{
return false;
}
for (int i = 0; i < pCommPropertyValueRecord->GetCols(); ++i)
{
xDataList.AddInt(0);
}
for (int i = NFrame::Player::BagEquipList::InlayStone1; i <= NFrame::Player::BagEquipList::InlayStone10; ++i)
{
int nIndex = i - NFrame::Player::BagEquipList::InlayStone1;
if (nIndex > nSlotCount)
{
break;
}
const std::string& strGemID = pBagRecord->GetString(nRow, i);
if (strGemID.empty())
{
continue;
}
const std::string& strGemEffectData = m_pElementModule->GetPropertyString(strGemID, NFrame::Item::EffectData());
if (strGemEffectData.empty())
{
continue;
}
//one gem
for (int j = 0; j < pCommPropertyValueRecord->GetCols(); ++j)
{
const std::string& strColTag = pCommPropertyValueRecord->GetColTag(j);
int64_t nValue = m_pElementModule->GetPropertyInt(strGemEffectData, strColTag);
int64_t nOldValue = xDataList.Int(j);
xDataList.SetInt(j, nOldValue + nValue);
}
}
return true;
}
示例11: CalEquipProperty
bool NFCEquipPropertyModule::CalEquipProperty(const NFGUID& self, const NFGUID& xEquipGUID, NFDataList& xDataList)
{
NF_SHARE_PTR<NFIRecord> pBagRecord = m_pKernelModule->FindRecord(self, NFrame::Player::BagEquipList::ThisName());
if (nullptr == pBagRecord)
{
return false;
}
NF_SHARE_PTR<NFIRecord> pCommPropertyValueRecord = m_pKernelModule->FindRecord(self, NFrame::Player::CommValue::ThisName());
if (nullptr == pCommPropertyValueRecord)
{
return false;
}
NFDataList varFind;
if (pBagRecord->FindObject(NFrame::Player::BagEquipList::GUID, xEquipGUID, varFind) != 1)
{
return false;
}
//const int nRow = varFind.Int32(0);
xDataList.Clear();
NFDataList xEquipBaseValue;
CalEquipBaseProperty(self, xEquipGUID, xEquipBaseValue);
NFDataList xEquipRandonValue;
CalEquipRandomProperty(self, xEquipGUID, xEquipRandonValue);
NFDataList xEquipGemValue;
CalEquipGemProperty(self, xEquipGUID, xEquipGemValue);
NFDataList xEquipIntensifyValue;
CalEquipIntensifyProperty(self, xEquipGUID, xEquipIntensifyValue);
NFDataList xEquipElementValue;
CalEquipElementProperty(self, xEquipGUID, xEquipElementValue);
for (int i = 0; i < pCommPropertyValueRecord->GetCols(); ++i)
{
int64_t nBaseValue = 0;
int64_t nRandonValue = 0;
int64_t nGemValue = 0;
int64_t nIntensifyValue = 0;
int64_t nElementValue = 0;
if (xEquipBaseValue.GetCount() == pCommPropertyValueRecord->GetCols())
{
nBaseValue = xEquipBaseValue.Int(i);
}
if (xEquipRandonValue.GetCount() == pCommPropertyValueRecord->GetCols())
{
nRandonValue = xEquipRandonValue.Int(i);
}
if (xEquipGemValue.GetCount() == pCommPropertyValueRecord->GetCols())
{
nGemValue = xEquipGemValue.Int(i);
}
if (xEquipIntensifyValue.GetCount() == pCommPropertyValueRecord->GetCols())
{
nIntensifyValue = xEquipIntensifyValue.Int(i);
}
if (xEquipElementValue.GetCount() == pCommPropertyValueRecord->GetCols())
{
nElementValue = xEquipElementValue.Int(i);
}
int64_t nAllValue = nBaseValue + nRandonValue + nGemValue + nIntensifyValue + nElementValue;
xDataList.AddInt(nAllValue);
}
return true;
}