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


C++ NF_SHARE_PTR::GetInt方法代码示例

本文整理汇总了C++中NF_SHARE_PTR::GetInt方法的典型用法代码示例。如果您正苦于以下问题:C++ NF_SHARE_PTR::GetInt方法的具体用法?C++ NF_SHARE_PTR::GetInt怎么用?C++ NF_SHARE_PTR::GetInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NF_SHARE_PTR的用法示例。


在下文中一共展示了NF_SHARE_PTR::GetInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetProduceDataCount

bool NFCSLGBuildingModule::GetProduceDataCount( const NFGUID& self, const NFGUID& xBuilID, const std::string& strItemID, int& nCount )
{
    NF_SHARE_PTR<NFIRecord> pProduce = m_pKernelModule->FindRecord(self, "BuildingProduce");
    if (NULL == pProduce.get())
    {
        m_pLogModule->LogNormal(NFILogModule::NLL_ERROR_NORMAL, self, "this is no [BuildingProduce] Record!", "", __FUNCTION__, __LINE__);
        return false;
    }

    NFDataList varProduce;
    pProduce->FindObject("BuildingGUID", xBuilID, varProduce);

    if(varProduce.GetCount() <= 0)
    {
        nCount = 0;
        return true;
    }

    for (int i = 0; i< varProduce.GetCount(); i++)
    {
        const std::string& strHasItemID = pProduce->GetString(i, "ItemID");
        if (strHasItemID  == strItemID)
        {
            const int nOldCount = pProduce->GetInt(i, "LeftCount");
            nCount = pProduce->GetInt(i, "LeftCount");

            return true;
        }
    }

    return false;
}
开发者ID:MacroGu,项目名称:NoahGameFrame,代码行数:32,代码来源:NFCSLGBuildingModule.cpp

示例2: CheckProduceData

int NFCSLGBuildingModule::CheckProduceData( const NFGUID& self )
{
    NF_SHARE_PTR<NFIRecord> pProduce = m_pKernelModule->FindRecord(self, "BuildingProduce");
    if (NULL == pProduce.get())
    {
        m_pLogModule->LogNormal(NFILogModule::NLL_ERROR_NORMAL, self, "this is no [BuildingProduce] Record!", "", __FUNCTION__, __LINE__);
        return false;
    }

    for (int i = 0; i < pProduce->GetRows(); i++)
    {
        if (!pProduce->IsUsed(i))
        {
            continue;
        }

        const int nNowTime = pPluginManager->GetNowTime();
        const NFGUID xBuildID = pProduce->GetObject(i, "BuildingGUID");
        const std::string strItemID = pProduce->GetString(i, "ItemID");
        const int nLeftCount = pProduce->GetInt(i, "LeftCount");
        const NFINT64 nLastOnceBeginTime = pProduce->GetInt(i, "OnceStartTime");
        const NFINT64 nOnceTime = pProduce->GetInt(i, "OnceTime");

        const int nPassTime = nNowTime - nLastOnceBeginTime;
        if (nPassTime <= 0)
        {
            continue;
        }

        const int nCount = nPassTime/nOnceTime;
        if (nCount >= nLeftCount)
        {
            //add Item
            //TO ADD

            pProduce->Remove(i);
        }
        else
        {
            //add Item
            //TO ADD

            pProduce->SetInt(i, "", nLeftCount - nCount);

            
            //NFDataList varHeart;
            //varHeart << xBuildID;
            //varHeart << strItemID;

            const std::string strHeartname = GetProduceHeartName(self, xBuildID, strItemID);
            const int nTime = (nCount + 1) * nOnceTime - nPassTime;
			m_pScheduleModule->AddSchedule(self, strHeartname, this, &NFCSLGBuildingModule::OnProduceHeartBeat, /*varHeart, */nTime, 1);
        }
    }

    return 0;
}
开发者ID:MacroGu,项目名称:NoahGameFrame,代码行数:57,代码来源:NFCSLGBuildingModule.cpp

示例3: CheckBuildingStatusEnd

int NFCSLGBuildingModule::CheckBuildingStatusEnd( const NFGUID& self )
{
    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;
    }

    const NFINT64 nNowTime = pPluginManager->GetNowTime();
    for (int i= 0; i < pRecord->GetRows(); i++)
    {
        if (!pRecord->IsUsed(i))
        {
            continue;
        }

        const NFINT64 nEndTime = pRecord->GetInt(i, "StateEndTime");
        const NFGUID& xBuildID = pRecord->GetObject(i, "BuildingGUID");
        const int& nStatus = pRecord->GetInt(i, "State");

        float fTime = nEndTime - nNowTime;
        if (fTime <= 0.0f)
        {
            fTime = 0.1f;
        }

        if (nStatus == NFMsg::EBS_IDLE)
        {
            continue;
        }
        else if(nStatus == NFMsg::EBS_UPGRADE)
        {
            //NFDataList varHeart;
            //varHeart << xBuildID;

			m_pScheduleModule->AddSchedule(self, "OnUpgradeHeartBeat", this, &NFCSLGBuildingModule::OnUpgradeHeartBeat, /*varHeart, */fTime, 1);
        }
        else if(nStatus == NFMsg::EBS_BOOST)
        {
            //NFDataList varHeart;
            //varHeart << xBuildID;

			m_pScheduleModule->AddSchedule(self, "OnUpgradeHeartBeat", this, &NFCSLGBuildingModule::OnUpgradeHeartBeat, /*varHeart, */fTime, 1);
        }
    }

    return 0;
}
开发者ID:MacroGu,项目名称:NoahGameFrame,代码行数:49,代码来源:NFCSLGBuildingModule.cpp

示例4: GetMemberList

bool NFCTeamModule::GetMemberList(const NFGUID& self, const NFGUID& xTeam, std::vector<NFGUID>& xmemberList)
{
    NF_SHARE_PTR<NFIRecordManager> pRecordManager = m_pCommonRedisModule->GetCacheRecordInfo(xTeam, NFrame::Team::ThisName());
    if (!pRecordManager)
    {
        return false;
    }

    NF_SHARE_PTR<NFIRecord> pMemberRecord = pRecordManager->GetElement(NFrame::Team::MemberList::ThisName());
    if (!pMemberRecord.get())
    {
        return false;
    }

    for (int i = 0; i < pMemberRecord->GetRows(); i++)
    {
        if (!pMemberRecord->IsUsed(i))
        {
            continue;
        }

        const NFINT64 nOnline = pMemberRecord->GetInt(i, NFrame::Team::MemberList::Online);
        const NFINT64 nGameID = pMemberRecord->GetInt(i, NFrame::Team::MemberList::GameID);
        const NFGUID& xID = pMemberRecord->GetObject(i, NFrame::Team::MemberList::GUID);
        if (!xID.IsNull())
        {

            xmemberList.push_back(xID);
        }
    }

    return true;
}
开发者ID:ik3210,项目名称:NoahGameFrame,代码行数:33,代码来源:NFCTeamModule.cpp

示例5: GetEquipElementLevel

int NFCEquipModule::GetEquipElementLevel(const NFGUID & self, const NFGUID & id, NFrame::Player::BagEquipList eIndex)
{
	if (id.IsNull() || self.IsNull())
	{
		return -1;
	}

	if (eIndex > NFrame::Player::BagEquipList_ElementLevel5_POISON
		|| eIndex < NFrame::Player::BagEquipList_ElementLevel1_FIRE)
	{
		return -1;
	}

	NF_SHARE_PTR<NFIObject> pObject = m_pKernelModule->GetObject(self);
	if (NULL == pObject)
	{
		return -1;
	}

	NF_SHARE_PTR<NFIRecord> pRecord = pObject->GetRecordManager()->GetElement(NFrame::Player::R_BagEquipList());
	if (!pRecord)
	{
		return -1;
	}

	NFCDataList xDataList;
	pRecord->FindObject(NFrame::Player::BagEquipList_GUID, id, xDataList);
	if (xDataList.GetCount() != 1)
	{
		return -1;
	}

	const int nRow = xDataList.Int(0);
	return pRecord->GetInt(nRow, eIndex);
}
开发者ID:xinst,项目名称:NoahGameFrame,代码行数:35,代码来源:NFCEquipModule.cpp

示例6: AddEquipIntensifyLevel

bool NFCEquipModule::AddEquipIntensifyLevel(const NFGUID& self, const NFGUID& id)
{
	if (id.IsNull() || self.IsNull())
	{
		return false;
	}

	NF_SHARE_PTR<NFIObject> pObject = m_pKernelModule->GetObject(self);
	if (NULL == pObject)
	{
		return false;
	}

	NF_SHARE_PTR<NFIRecord> pRecord = pObject->GetRecordManager()->GetElement(NFrame::Player::R_BagEquipList());
	if (!pRecord)
	{
		return false;
	}

	NFCDataList xDataList;
	pRecord->FindObject(NFrame::Player::BagEquipList_GUID, id, xDataList);
	if (xDataList.GetCount() != 1)
	{
		return false;
	}

	const int nRow = xDataList.Int(0);
	const int nLevel = pRecord->GetInt(nRow, NFrame::Player::BagEquipList_IntensifyLevel);
	pRecord->SetInt(nRow, NFrame::Player::BagEquipList_IntensifyLevel, nLevel + 1);

	return true;
}
开发者ID:xinst,项目名称:NoahGameFrame,代码行数:32,代码来源:NFCEquipModule.cpp

示例7: DownGuildMmember

bool NFCGuildModule::DownGuildMmember( const NFGUID& self, const NFGUID& xGuildID, const NFGUID& xMmember )
{
    NF_SHARE_PTR<NFIObject> pGuildObject = m_pGuildDataModule->GetGuild(xGuildID);
    if (!pGuildObject.get())
    {
        return false;
    }

    NF_SHARE_PTR<NFIRecord> pMemberRecord = m_pKernelModule->FindRecord(xGuildID, NFrame::Guild::R_GuildMemberList());
    if (!pMemberRecord.get())
    {
        return false;
    }

    CheckPower(self, xGuildID, NFMsg::ReqAckOprGuildMember::EGAT_DOWN);

    NFDataList varList;
    pMemberRecord->FindObject(NFrame::Guild::GuildMemberList_GUID, self, varList);
    if (varList.GetCount() == 0)
    {
        return false;
    }

    const int nRow = varList.Int(0);

    const int nPower = pMemberRecord->GetInt(nRow, NFrame::Guild::GuildMemberList_Power);
    if (nPower == 0)
    {
        return false;
    }

    pMemberRecord->SetInt(nRow, NFrame::Guild::GuildMemberList_Power, (nPower - 1));
    return true;
}
开发者ID:,项目名称:,代码行数:34,代码来源:

示例8: GetEquipHoleCount

int NFCEquipModule::GetEquipHoleCount(const NFGUID & self, const NFGUID & id)
{
	if (id.IsNull() || self.IsNull())
	{
		return false;
	}

	NF_SHARE_PTR<NFIObject> pObject = m_pKernelModule->GetObject(self);
	if (NULL == pObject)
	{
		return false;
	}

	NF_SHARE_PTR<NFIRecord> pRecord = pObject->GetRecordManager()->GetElement(NFrame::Player::R_BagEquipList());
	if (!pRecord)
	{
		return false;
	}

	NFCDataList xDataList;
	pRecord->FindObject(NFrame::Player::BagEquipList_GUID, id, xDataList);
	if (xDataList.GetCount() != 1)
	{
		return false;
	}

	const int nRow = xDataList.Int(0);
	return pRecord->GetInt(nRow, NFrame::Player::BagEquipList_SlotCount);
}
开发者ID:xinst,项目名称:NoahGameFrame,代码行数:29,代码来源:NFCEquipModule.cpp

示例9: DeleteItem

bool NFCPackModule::DeleteItem( const NFGUID& self, const std::string& strItemConfigID, const int nCount )
{
	if(nCount <= 0)
	{
		return false;
	}

	NF_SHARE_PTR<NFIObject> pObject = m_pKernelModule->GetObject( self );
	if ( NULL == pObject )
	{
		return false;
	}

	//还得确定有这个装备
	if (!m_pElementModule->ExistElement(NFrame::Item::ThisName(), strItemConfigID))
	{
		return false;
	}

	NF_SHARE_PTR<NFIRecord> pRecord = pObject->GetRecordManager()->GetElement( NFrame::Player::R_BagItemList() );
	if (!pRecord)
	{
		return false;
	}

	NFCDataList varFindResult;
	int nFindRowCount = pRecord->FindString(NFrame::Player::BagItemList_ConfigID, strItemConfigID, varFindResult);
	if (nFindRowCount > 0)
	{
		int nNeedDelCount = nCount;
		for (int i = 0; i < varFindResult.GetCount(); ++i)
		{
			int nFindRow = varFindResult.Int(i);
			int nOldCount = pRecord->GetInt(nFindRow, NFrame::Player::BagItemList_ItemCount);
			if (nOldCount > nNeedDelCount)
			{
				int nNewCount = nOldCount - nNeedDelCount;
				pRecord->SetInt(nFindRow, NFrame::Player::BagItemList_ItemCount, nNewCount);
				nNeedDelCount = 0;
			}
			else if (nOldCount == nNeedDelCount)
			{
				pRecord->Remove(nFindRow);
				nNeedDelCount = 0;
			}
			else if (nOldCount < nNeedDelCount)
			{
				pRecord->Remove(nFindRow);
				nNeedDelCount -= nOldCount;
			}
		}

		if (nNeedDelCount <= 0)
		{
			return true;
		}
	}

	return false;
}
开发者ID:zh423328,项目名称:NFServer,代码行数:60,代码来源:NFCPackModule.cpp

示例10: UpGuildMmember

bool NFCWorldGuildModule::UpGuildMmember( const NFIDENTID& self, const NFIDENTID& xGuildID, const NFIDENTID& xMmember )
{
    NF_SHARE_PTR<NFIObject> pGuildObject = m_pWorldGuildDataModule->GetGuild(xGuildID);
    if (!pGuildObject.get())
    {
        return false;
    }

    NF_SHARE_PTR<NFIRecord> pMemberRecord = m_pKernelModule->FindRecord(xGuildID, "GuildMemberList");
    if (!pMemberRecord.get())
    {
        return false;
    }

    CheckPower(self, xGuildID, NFMsg::ReqAckOprGuildMember::EGAT_UP);

    NFCDataList varList;
    pMemberRecord->FindObject(NFMsg::GuildMemberList_GUID, self, varList);
    if (varList.GetCount() == 0)
    {
        return false;
    }

    const int nRow = varList.Int(0);

    const int nPower = pMemberRecord->GetInt(nRow, NFMsg::GuildMemberList_Power);

    if (nPower >= NFMsg::GUILD_POWER_TYPE_PRESIDENT)
    {
        return false;
    }

    pMemberRecord->SetInt(nRow, NFMsg::GuildMemberList_Power, (nPower + 1)) ;
	return true;
}
开发者ID:joyfish,项目名称:NoahGameFrame,代码行数:35,代码来源:NFCWorldGuildModule.cpp

示例11: GetOnlineMember

bool NFCGuildModule::GetOnlineMember( const NFGUID& self, const NFGUID& xGuild, NFDataList& varMemberList, NFDataList& varGameList)
{
    NF_SHARE_PTR<NFIObject> pGuildObject = m_pGuildDataModule->GetGuild(xGuild);
    if (!pGuildObject.get())
    {
        return false;
    }

    NF_SHARE_PTR<NFIRecord> pMemberRecord = m_pKernelModule->FindRecord(xGuild, NFrame::Guild::R_GuildMemberList());
    if (!pMemberRecord.get())
    {
        return false;
    }

    for (int i = 0; i< pMemberRecord->GetRows(); i++)
    {
        if (!pMemberRecord->IsUsed(i))
        {
            continue;
        }

        const NFINT64 nOnline = pMemberRecord->GetInt(i, NFrame::Guild::GuildMemberList_Online);
        const NFINT64 nGameID = pMemberRecord->GetInt(i, NFrame::Guild::GuildMemberList_GameID);
        const NFGUID& xID = pMemberRecord->GetObject(i, NFrame::Guild::GuildMemberList_GUID);
        if (nOnline > 0 && !xID.IsNull())
        {

            varMemberList.Add(xID);
            varGameList.Add(nGameID);
        }
    }

    return true;
}
开发者ID:,项目名称:,代码行数:34,代码来源:

示例12: GetPropertyInt

NFINT64 NFCPropertyManager::GetPropertyInt(const std::string& strPropertyName)
{
    NF_SHARE_PTR<NFIProperty> pProperty = GetElement(strPropertyName);
    if (pProperty)
    {
        return pProperty->GetInt();
    }

    return 0;
}
开发者ID:,项目名称:,代码行数:10,代码来源:

示例13: GetRecordInt

NFINT64 NFCRecordManager::GetRecordInt(const std::string& strRecordName, const int nRow, const std::string& strColTag)
{
	NF_SHARE_PTR<NFIRecord> pRecord = GetElement(strRecordName);
	if (pRecord.get())
	{
		return pRecord->GetInt(nRow, strColTag);
	}

	return 0;
}
开发者ID:AnakinSong,项目名称:NoahGameFrame,代码行数:10,代码来源:NFCRecordManager.cpp

示例14: GetPropertyInt

NFINT64 NFCElementInfoModule::GetPropertyInt(const std::string& strConfigName, const std::string& strPropertyName)
{
    NF_SHARE_PTR<NFIProperty> pProperty = GetProperty(strConfigName, strPropertyName);
    if (pProperty.get())
    {
        return pProperty->GetInt();
    }

    return 0;
}
开发者ID:Kiddinglife,项目名称:NoahGameFrame,代码行数:10,代码来源:NFCElementInfoModule.cpp

示例15: GetFieldInt

const int NFCCommonConfigModule::GetFieldInt(const std::string& strStructName, const std::string& strStructItemName, const std::string& strAttribute)
{
	NF_SHARE_PTR<CStructInfo> pSDKInfo = mmData.GetElement(strStructName);
	if (pSDKInfo)
	{
		NF_SHARE_PTR<CAttributeList> pParam = pSDKInfo->GetElement(strStructItemName);
		if (pParam)
		{
			return pParam->GetInt(strAttribute);
		}
	}

	return 0;
}
开发者ID:MacroGu,项目名称:NoahGameFrame,代码行数:14,代码来源:NFCCommonConfigModule.cpp


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