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


C++ GuidSet::clear方法代码示例

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


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

示例1: Reset

    void Reset() override
    {
        for (unsigned int& i : m_uiSpiritTimer)
            i = urand(0, 1000);

        m_sSpiritsGuidsSet.clear();
    }
开发者ID:Ghaster,项目名称:mangos-classic,代码行数:7,代码来源:boss_ambassador_flamelash.cpp

示例2: DespawnIntroCreatures

    void DespawnIntroCreatures()
    {
        if (m_pInstance)
        {
            for (GuidSet::const_iterator itr = m_lIntroMobsSet.begin(); itr != m_lIntroMobsSet.end(); ++itr)
            {
                if (Creature* pCreature = m_pInstance->instance->GetCreature(*itr))
                    pCreature->ForcedDespawn();
            }
        }

        m_lIntroMobsSet.clear();
    }
开发者ID:conan513,项目名称:mangos-wotlk,代码行数:13,代码来源:boss_kelthuzad.cpp

示例3: DespawnAdds

    void DespawnAdds()
    {
        if (m_pInstance)
        {
            for (GuidSet::const_iterator itr = m_lAddsSet.begin(); itr != m_lAddsSet.end(); ++itr)
            {
                if (Creature* pCreature = m_pInstance->instance->GetCreature(*itr))
                {
                    if (pCreature->isAlive())
                    {
                        pCreature->AI()->EnterEvadeMode();
                        pCreature->ForcedDespawn(15000);
                    }
                }
            }
        }

        m_lAddsSet.clear();
    }
开发者ID:conan513,项目名称:mangos-wotlk,代码行数:19,代码来源:boss_kelthuzad.cpp

示例4: Reset

 void Reset() override
 {
     m_uiVisualTimer = 1000;
     m_sWretchedGuids.clear();
 }
开发者ID:AlexHjelm,项目名称:Core,代码行数:5,代码来源:boss_selin_fireheart.cpp

示例5: Reset

 void Reset() override
 {
     Initialize();
     _Reset();
     lWrappedPlayers.clear();
 }
开发者ID:Lyill,项目名称:TrinityCore,代码行数:6,代码来源:boss_slad_ran.cpp

示例6: SendLfgUpdateList

void WorldSession::SendLfgUpdateList(uint32 dungeonID)
{
    if (!sWorld.getConfig(CONFIG_BOOL_LFR_ENABLE))
    {
        DEBUG_LOG("SendLfgUpdateList %u failed - Raid finder disabled", GetPlayer()->GetObjectGuid().GetCounter());
        return;
    }

    DEBUG_LOG("SMSG_LFG_SEARCH_RESULTS %u dungeonentry: %u ", GetPlayer()->GetObjectGuid().GetCounter(), dungeonID);

    LFGDungeonEntry const* dungeon = sLFGMgr.GetDungeon(dungeonID);

    if (!dungeon)
        return;

    Team team = sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_GROUP) ? TEAM_NONE : GetPlayer()->GetTeam();

    GuidSet groups = sLFGMgr.GetDungeonGroupQueue(dungeon, team);
    GuidSet players = sLFGMgr.GetDungeonPlayerQueue(dungeon, team);

    uint32 groupCount = groups.size();
    uint32 groupSize = 4+4;

    for (GuidSet::const_iterator itr = groups.begin(); itr != groups.end(); ++itr)
    {
        Group* pGroup   = sObjectMgr.GetGroup(*itr);
        if (!pGroup)
            continue;

        Player* pLeader = sObjectMgr.GetPlayer(pGroup->GetLeaderGuid());
        if (!pLeader)
            continue;

        sLFGMgr.GetLFGPlayerState(pLeader->GetObjectGuid())->AddFlags(LFG_MEMBER_FLAG_CHARINFO |
                                        LFG_MEMBER_FLAG_COMMENT |
                                        LFG_MEMBER_FLAG_GROUPLEADER |
                                        LFG_MEMBER_FLAG_GROUPGUID |
                                        LFG_MEMBER_FLAG_ROLES |
                                        LFG_MEMBER_FLAG_AREA  |
                                        LFG_MEMBER_FLAG_STATUS  |
                                        LFG_MEMBER_FLAG_BIND);

        uint32 flags = sLFGMgr.GetLFGPlayerState(pLeader->GetObjectGuid())->GetFlags();

        if (flags & LFG_MEMBER_FLAG_COMMENT)
            groupSize += sLFGMgr.GetLFGPlayerState(pLeader->GetObjectGuid())->GetComment().size()+1;
        if (flags & LFG_MEMBER_FLAG_ROLES)
            groupSize +=3;
        if (flags & LFG_MEMBER_FLAG_BIND)
            groupSize += (8+4);

        players.insert(*itr);

        for (GroupReference *itr2 = pGroup->GetFirstMember(); itr2 != NULL; itr2 = itr2->next())
        {
            Player* player = itr2->getSource();

            if (!player || player == pLeader)
                continue;

            sLFGMgr.GetLFGPlayerState(player->GetObjectGuid())->AddFlags(LFG_MEMBER_FLAG_GROUPLEADER |
                                        LFG_MEMBER_FLAG_GROUPGUID |
                                        LFG_MEMBER_FLAG_STATUS);

            sLFGMgr.GetLFGPlayerState(player->GetObjectGuid())->RemoveFlags(LFG_MEMBER_FLAG_CHARINFO |
                                        LFG_MEMBER_FLAG_COMMENT |
                                        LFG_MEMBER_FLAG_ROLES |
                                        LFG_MEMBER_FLAG_AREA  |
                                        LFG_MEMBER_FLAG_BIND);
            players.insert(player->GetObjectGuid());
        }

    }

    uint32 playerCount = players.size();
    uint32 playerSize = 4+4;

    uint32 guidsSize = 0;
    GuidSet playersUpdated;
    playersUpdated.clear();

    for(GuidSet::const_iterator itr = players.begin(); itr != players.end(); ++itr)
    {
        Player* player   = sObjectMgr.GetPlayer(*itr);

        if (!player || !player->IsInWorld())
            continue;

        uint32 flags = sLFGMgr.GetLFGPlayerState(player->GetObjectGuid())->GetFlags();

        playerSize += (8+4);

        if (flags &  LFG_MEMBER_FLAG_CHARINFO)
            playerSize += (1+1+1+3+4+4+4+4+4+4+4+4+4+4+4+4+4+4+4+4+4+4+4+4);

        if (flags & LFG_MEMBER_FLAG_COMMENT)
            playerSize += sLFGMgr.GetLFGPlayerState(player->GetObjectGuid())->GetComment().size()+1;         // comment

        if (flags & LFG_MEMBER_FLAG_GROUPLEADER)
            playerSize += 1;
//.........这里部分代码省略.........
开发者ID:mangosR2,项目名称:mangos,代码行数:101,代码来源:LFGHandler.cpp


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