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


C++ NFGUID::IsNull方法代码示例

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


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

示例1: 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

示例2: 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

示例3: DressEquipForHero

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

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

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

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

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

	NFCDataList xHeroDataList;
	pHeroRecord->FindObject(NFrame::Player::PlayerHero_GUID, hero, xHeroDataList);
	if (xHeroDataList.GetCount() != 1)
	{
		return false;
	}

	const int nEquipRow = xEquipDataList.Int(0);
	const int nHeroRow = xHeroDataList.Int(0);
	const std::string& strEquipID = pBagRecord->GetString(nEquipRow, NFrame::Player::BagEquipList_ConfigID);
	const int nEquipPos = m_pElementModule->GetPropertyInt(strEquipID, NFrame::Equip::ItemSubType());

    if (nEquipRow < 0
		|| nHeroRow < 0
		|| strEquipID.empty()
		|| nEquipPos < 0
		|| nEquipPos > (NFrame::Player::PlayerHero_Equip6 - NFrame::Player::PlayerHero_Equip1))
    {
		return false;
    }

	//so there have any bind?
	//hero, position
	pHeroRecord->SetObject(nHeroRow, nEquipPos + NFrame::Player::PlayerHero_Equip1, id);
	pBagRecord->SetObject(nEquipRow, NFrame::Player::BagEquipList_WearGUID, hero);

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

示例4: 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

示例5: Execute

bool NFCPatrolState::Execute(const NFGUID& self)
{
    if (!NFIState::Execute(self))
    {
        NFIStateMachine* pStateMachine = m_pAIModule->GetStateMachine(self);
        if (pStateMachine)
        {
			NFGUID ident = m_pHateModule->QueryMaxHateObject(self);
			NFAI_MOVE_TYPE eMoveType = (NFAI_MOVE_TYPE)(m_pKernelModule->GetPropertyInt(self, "MoveType"));

			//如果是定点的,则不走,继续idle
			switch (eMoveType)
			{
			case NFAI_MOVE_TYPE::MOVE_BY_POINT_LIST:
				{
					//查找是否有可以攻击的对象
					if (!ident.IsNull())
					{
						pStateMachine->ChangeState(FightState);
					}
					else
					{
						//下一个节点
                        //object记录当前的路径ID和index,以记录寻路的位置
					}
				}
				break;

			case NFAI_MOVE_TYPE::MOVE_BY_RANDOM:
				{
					//查找是否有可以攻击的对象
					if (!ident.IsNull())
					{
						pStateMachine->ChangeState(FightState);
					}
					else
					{
						RandomPatrol(self);
					}
				}
				break;
			default:
				break;
			}
        }
    }

    return true;
}
开发者ID:zh423328,项目名称:NFServer,代码行数:49,代码来源:NFCPatrolState.cpp

示例6: SetEquipInlayStoneID

bool NFCEquipModule::SetEquipInlayStoneID(const NFGUID& self, const NFGUID& id, NFrame::Player::BagEquipList eIndex, const std::string& strStoneID)
{
	if (id.IsNull() || self.IsNull() || strStoneID.empty())
	{
		return false;
	}

	if (eIndex > NFrame::Player::BagEquipList_InlayStone10
		|| eIndex < NFrame::Player::BagEquipList_InlayStone1)
	{
		return false;
	}

	if (!m_pElementModule->ExistElement(strStoneID))
	{
		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 nSoltCount = pRecord->GetInt(nRow, NFrame::Player::BagEquipList_SlotCount);
	if ((eIndex - NFrame::Player::BagEquipList_InlayStone1) <= nSoltCount)
	{
		return false;
	}

	pRecord->SetString(nRow, eIndex, strStoneID);

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

示例7: SetFightHero

bool NFCHeroModule::SetFightHero(const NFGUID& self, const NFGUID& xHeroID, const int nPos)
{
	NF_SHARE_PTR<NFIRecord> pHeroRecord = m_pKernelModule->FindRecord(self, NFrame::Player::PlayerHero::ThisName());
	if (nullptr == pHeroRecord)
	{
		return false;
	}

	if (xHeroID.IsNull())
	{
		return false;
	}

	int nRow = pHeroRecord->FindObject(NFrame::Player::PlayerHero::GUID, xHeroID);
	if (nRow < 0)
	{
		return false;
	}

	int nActivite = pHeroRecord->GetInt32(nRow, NFrame::Player::PlayerHero::Activated);
	if (nActivite <= 0)
	{
		return false;
	}

	AddToFightList(self, xHeroID, nPos);


	return false;
}
开发者ID:bluesky7290,项目名称:NoahGameFrame,代码行数:30,代码来源:NFCHeroModule.cpp

示例8: GetStatusRoomID

bool NFCPVPMatchRedisModule::GetStatusRoomID(const int nPVPMode, const int nGrade, const int nStatus, std::vector<NFGUID>& xRoomIDList)
{
	NF_SHARE_PTR<NFINoSqlDriver> pNoSqlDriver = m_pNoSqlModule->GetDriverBySuitConsistent();
    if (pNoSqlDriver)
    {
        std::string strKey = MakeStatusRoomIDRedisKey(nPVPMode, nGrade, nStatus);
        std::string strData;

        std::vector<std::string> valueVec;
        if (pNoSqlDriver->HValues(strKey, valueVec))
        {
            for (int i = 0; i < valueVec.size(); i++)
            {
                NFGUID xIdent;
                xIdent.FromString(valueVec[i]);
                if (!xIdent.IsNull())
                {
                    xRoomIDList.push_back(xIdent);
                }
            }

            return true;
        }
    }

    return false;
}
开发者ID:xinst,项目名称:NoahGameFrame,代码行数:27,代码来源:NFCPVPMatchRedisModule.cpp

示例9: HeroSkillUp

bool NFCHeroModule::HeroSkillUp(const NFGUID& self, const NFGUID& xHeroID, const int nIndex)
{
	if (xHeroID.IsNull())
	{
		return false;
	}

	if (nIndex > NFrame::Player::PlayerHero::Skill5 && nIndex < NFrame::Player::PlayerHero::Skill1)
	{
		return false;
	}

	NF_SHARE_PTR<NFIRecord> pHeroRecord = m_pKernelModule->FindRecord(self, NFrame::Player::PlayerHero::ThisName());
	if (nullptr == pHeroRecord)
	{
		return false;
	}

	int nRow = pHeroRecord->FindObject(NFrame::Player::PlayerHero::GUID, xHeroID);
	if (nRow < 0)
	{
		return false;
	}

	const std::string& strSkillID = pHeroRecord->GetString(nRow, nIndex);
	const std::string& strNextSkillID = m_pElementModule->GetPropertyString(strSkillID, NFrame::Skill::NextID());
	if (strNextSkillID.empty())
	{
		//no next talent id, this skill is the best talent
		return false;
	}

	pHeroRecord->SetString(nRow, nIndex, strNextSkillID);
	return true;
}
开发者ID:bluesky7290,项目名称:NoahGameFrame,代码行数:35,代码来源:NFCHeroModule.cpp

示例10: HeroStarUp

bool NFCHeroModule::HeroStarUp(const NFGUID& self, const NFGUID& xHeroID)
{
	NF_SHARE_PTR<NFIRecord> pHeroRecord = m_pKernelModule->FindRecord(self, NFrame::Player::PlayerHero::ThisName());
	if (nullptr == pHeroRecord.get())
	{
		return false;
	}

	if (xHeroID.IsNull())
	{
		return false;
	}

	int nRow = pHeroRecord->FindObject(NFrame::Player::PlayerHero::GUID, xHeroID);
	if (nRow < 0)
	{
		return false;
	}

	const int nBeforeStar = pHeroRecord->GetInt32(nRow, NFrame::Player::PlayerHero::Star);

	int nAfterStar = nBeforeStar + 1;
	if (nAfterStar > ECONSTDEFINE_HERO_MAXSTAR)
	{
		nAfterStar = ECONSTDEFINE_HERO_MAXSTAR;
	}

	pHeroRecord->SetInt(nRow, NFrame::Player::PlayerHero::Star, nAfterStar);

	return true;
}
开发者ID:bluesky7290,项目名称:NoahGameFrame,代码行数:31,代码来源:NFCHeroModule.cpp

示例11: SetObject

bool NFCProperty::SetObject(const NFGUID& value)
{
	if (eType != TDATA_OBJECT)
	{
		return false;
	}

	if (!mxData.get())
	{
		//本身是空就是因为没数据,还来个没数据的就不存了
		if (value.IsNull())
		{
			return false;
		}

		mxData = NF_SHARE_PTR<NFIDataList::TData>(NF_NEW NFIDataList::TData(TDATA_OBJECT));
		mxData->SetObject(NFGUID());

	}

	if (value == mxData->GetObject())
	{
		return false;
	}

	NFCDataList::TData oldValue;
	oldValue = *mxData;

	mxData->SetObject(value);

	OnEventHandler(oldValue, *mxData);

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

示例12: CreateRoom

NFGUID NFCPVPMatchModule::CreateRoom(const NFGUID& self, const int nPVPMode, const int nGrade)
{
    NFGUID xRoomID = m_pKernelModule->CreateGUID();
    if (xRoomID.IsNull())
    {
        return NFGUID();
    }

    NFMsg::PVPRoomInfo xRoomInfo;

    xRoomInfo.set_ncellstatus(0);
    *xRoomInfo.mutable_roomid() = NFINetModule::NFToPB(xRoomID);
    xRoomInfo.set_npvpmode(nPVPMode);
    xRoomInfo.set_npvpgrade(nGrade);

    int nPVPModeMaxMember = GetMemberCount(nPVPMode);
    if (nPVPModeMaxMember < 0)
    {
        return NFGUID();
    }

    xRoomInfo.set_maxpalyer(nPVPModeMaxMember);
    if (!m_pPVPMatchRedisModule->SetRoomInfo(xRoomID, xRoomInfo))
    {
        return NFGUID();
    }

    return xRoomID;
}
开发者ID:ketoo,项目名称:NoahGameFrame,代码行数:29,代码来源:NFCPVPMatchModule.cpp

示例13: OnCreateTeamProcess

void NFCTeamModule::OnCreateTeamProcess(const NFSOCK nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen)
{
	CLIENT_MSG_PROCESS( nMsgID, msg, nLen, NFMsg::ReqAckCreateTeam);

	std::string strRoleName ;
	int nLevel = 0;
	int nJob = 0;
	int nDonation= 0;
	int nVIP= 0;

	NFGUID xTeam = CreateTeam(nPlayerID, NFINetModule::PBToNF(xMsg.team_id()), strRoleName, strRoleName, nLevel, nJob, nDonation, nVIP);

	if (!xTeam.IsNull())
	{
		NFMsg::ReqAckCreateTeam xAck;
		*xAck.mutable_team_id() = NFINetModule::NFToPB(xTeam);

        NFMsg::TeamInfo xTeamInfo;
        if (!GetTeamInfo(nPlayerID, xTeam, xTeamInfo))
        {
            xAck.mutable_xteaminfo()->CopyFrom(xTeamInfo);
            m_pNetModule->SendMsgPB(NFMsg::EGMI_ACK_CREATE_TEAM, xAck, nSockIndex, nPlayerID);
            return;
        }
    }

    NFMsg::ReqAckCreateTeam xAck;
    *xAck.mutable_team_id() = NFINetModule::NFToPB(xTeam);

    m_pNetModule->SendMsgPB(NFMsg::EGMI_ACK_CREATE_TEAM, xAck, nSockIndex, nPlayerID);
}
开发者ID:ik3210,项目名称:NoahGameFrame,代码行数:31,代码来源:NFCTeamModule.cpp

示例14: DeleteEquip

bool NFCPackModule::DeleteEquip( const NFGUID& self, const NFGUID& id )
{
	if (id.IsNull())
	{
		return false;
	}

	//删除3个地方,背包,英雄穿戴,玩家穿戴
	NF_SHARE_PTR<NFIObject> pObject = m_pKernelModule->GetObject( self );
	if (nullptr == pObject)
	{
		return false;
	}


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

	NFCDataList varFindResult;
	int nFindRowCount = pRecord->FindObject(NFrame::Player::BagItemList_ConfigID, id, varFindResult);
	if (nFindRowCount > 0)
	{
		int nTotalCount = 0;
		for (int i = 0; i < varFindResult.GetCount(); ++i)
		{
			int nFindRow = varFindResult.Int(i);
			pRecord->Remove(nFindRow);
		}
	}

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

示例15: Execute

bool NFPatrolState::Execute(const NFGUID& self, NFIStateMachine* pStateMachine)
{
    if (!NFIState::Execute(self, pStateMachine))
    {
			NFGUID ident = m_pHateModule->QueryMaxHateObject(self);
			NFAI_NPC_TYPE eMoveType = (NFAI_NPC_TYPE)(m_pKernelModule->GetPropertyInt(self, NFrame::NPC::NPCType()));

			//如果是定点的,则不走,继续idle
			switch (eMoveType)
			{
			case NFAI_NPC_TYPE::MASTER_TYPE:
				{
					//查找是否有可以攻击的对象
					if (!ident.IsNull())
					{
						pStateMachine->ChangeState(FightState);
					}
					else
					{
						//下一个节点
                        //object记录当前的路径ID和index,以记录寻路的位置
					}
				}
				break;

			case NFAI_NPC_TYPE::HERO_TYPE:
				{
					//查找是否有可以攻击的对象
					if (!ident.IsNull())
					{
						pStateMachine->ChangeState(FightState);
					}
					else
					{
						RandomPatrol(self, pStateMachine);
					}
				}
				break;
			default:
				break;
			}
    }

    return true;
}
开发者ID:ketoo,项目名称:NoahGameFrame,代码行数:45,代码来源:NFPatrolState.cpp


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