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


C++ GuidList::end方法代码示例

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


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

示例1: DoSearchZombieChow

    // Replaces missing spell 28236
    void DoSearchZombieChow()
    {
        for (GuidList::const_iterator itr = m_lZombieChowGuidList.begin(); itr != m_lZombieChowGuidList.end(); ++itr)
        {
            if (Creature* pZombie = m_creature->GetMap()->GetCreature(*itr))
            {
                if (!pZombie->isAlive())
                    continue;

                // Devour a Zombie
                if (pZombie->IsWithinDistInMap(m_creature, 15.0f))
                    m_creature->DealDamage(pZombie, pZombie->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
            }
        }
    }
开发者ID:Phatcat,项目名称:mangos-wotlk,代码行数:16,代码来源:boss_gluth.cpp

示例2: GetClosestLowerBunny

    // function to return the closest ground Bunny
    Creature* GetClosestLowerBunny(Creature* pSource)
    {
        if (m_lLowerBunniesGuids.empty())
            return NULL;

        std::list<Creature*> lBunnies;
        for (GuidList::const_iterator itr = m_lLowerBunniesGuids.begin(); itr != m_lLowerBunniesGuids.end(); ++itr)
        {
            if (Creature* pBunny = m_creature->GetMap()->GetCreature(*itr))
                lBunnies.push_back(pBunny);
        }

        lBunnies.sort(ObjectDistanceOrder(pSource));
        return lBunnies.front();
    }
开发者ID:dvdvideo1234,项目名称:mangos-wotlk,代码行数:16,代码来源:boss_thorim.cpp

示例3: DoSetupAdds

    void DoSetupAdds()
    {
        m_uiSetupAddsTimer = 0;

        if (!m_pInstance)
            return;

        GuidList lAddGuids;
        m_pInstance->GetKelidanAddList(lAddGuids);

        // Sort Adds to vector if not already done
        if (!lAddGuids.empty())
        {
            m_vAddGuids.reserve(lAddGuids.size());
            std::list<Creature*> lAdds;
            for (GuidList::const_iterator itr = lAddGuids.begin(); itr != lAddGuids.end(); ++itr)
            {
                if (Creature* pAdd = m_pInstance->instance->GetCreature(*itr))
                    lAdds.push_back(pAdd);
            }
            // Sort them by angle
            lAdds.sort(SortByAngle(m_creature));
            for (std::list<Creature*>::const_iterator itr = lAdds.begin(); itr != lAdds.end(); ++itr)
                m_vAddGuids.push_back((*itr)->GetObjectGuid());
        }

        // Respawn killed adds and reset counter
        m_uiKilledAdds = 0;
        for (GuidVector::const_iterator itr = m_vAddGuids.begin(); itr != m_vAddGuids.end(); ++itr)
        {
            Creature* pAdd = m_pInstance->instance->GetCreature(*itr);
            if (pAdd && !pAdd->isAlive())
                pAdd->Respawn();
        }

        // Cast pentagram
        uint8 s = m_vAddGuids.size();
        for (uint8 i = 0; i < s; ++i)
        {
            Creature* pCaster = m_pInstance->instance->GetCreature(m_vAddGuids[i]);
            Creature* pTarget = m_pInstance->instance->GetCreature(m_vAddGuids[(i + 2) % s]);
            if (pCaster && pTarget)
                pCaster->CastSpell(pTarget, SPELL_CHANNELING, TRIGGERED_NONE);
        }

        m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
        m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
    }
开发者ID:MantisLord,项目名称:mangos-tbc,代码行数:48,代码来源:boss_kelidan_the_breaker.cpp

示例4: CallBackSparks

    // make sparks come back
    void CallBackSparks()
    {
        for (GuidList::const_iterator itr = m_lSparkGUIDList.begin(); itr != m_lSparkGUIDList.end(); ++itr)
        {
            if (Creature* pSpark = m_creature->GetMap()->GetCreature(*itr))
            {
                if (pSpark->IsAlive())
                {
                    // Required to prevent combat movement, elsewise they might switch movement on aggro-change
                    if (ScriptedAI* pSparkAI = dynamic_cast<ScriptedAI*>(pSpark->AI()))
                        pSparkAI->SetCombatMovement(false);

                    pSpark->GetMotionMaster()->MovePoint(POINT_CALLBACK, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
                }
            }
        }
    }
开发者ID:jviljoen82,项目名称:ScriptDev3,代码行数:18,代码来源:boss_ionar.cpp

示例5: AttackedBy

    void AttackedBy(Unit* pAttacker) override
    {
        // When the Shade starts to attack Akama, switch to melee phase
        if (m_uiPhase == PHASE_CHANNEL && pAttacker->GetEntry() == NPC_SHADE_OF_AKAMA)
        {
            m_creature->InterruptNonMeleeSpells(false);
            AttackStart(pAttacker);
            m_uiPhase = PHASE_COMBAT;

            // despawn all sorcerers at this point
            for (GuidList::const_iterator itr = m_lSorcerersGUIDList.begin(); itr != m_lSorcerersGUIDList.end(); ++itr)
            {
                if (Creature* pSorcerer = m_creature->GetMap()->GetCreature(*itr))
                    pSorcerer->ForcedDespawn();
            }
        }
    }
开发者ID:AwkwardDev,项目名称:mangos-d3,代码行数:17,代码来源:boss_shade_of_akama.cpp

示例6: ConcatenateGuids

/**
   Given a list of guids returns the concatenation using | as delimiter

   @param[in]     check list of guids
   @returns Concatenated string
*/
std::string ConcatenateGuids(GuidList const& check)
{
    if (check.empty())
        return "";

    // need the guids in order to avoid duplicates
    GuidSet guids(check.begin(), check.end());

    std::ostringstream o;

    GuidSet::const_iterator it = guids.begin();
    o << it->GetRawValue();
    for (++it; it != guids.end(); ++it)
        o << '|' << it->GetRawValue();

    return o.str();
}
开发者ID:samaelsacred,项目名称:4.3.4,代码行数:23,代码来源:LFGQueue.cpp

示例7: SelectRandomPantherTrigger

Creature* instance_zulgurub::SelectRandomPantherTrigger(bool bIsLeft)
{
    GuidList* plTempList = bIsLeft ? &m_lLeftPantherTriggerGUIDList : &m_lRightPantherTriggerGUIDList;
    std::vector<Creature*> vTriggers;
    vTriggers.reserve(plTempList->size());

    for (GuidList::const_iterator itr = plTempList->begin(); itr != plTempList->end(); ++itr)
    {
        if (Creature* pTemp = instance->GetCreature(*itr))
            vTriggers.push_back(pTemp);
    }

    if (vTriggers.empty())
        return NULL;

    return vTriggers[urand(0, vTriggers.size()-1)];
}
开发者ID:Atari007,项目名称:master,代码行数:17,代码来源:instance_zulgurub.cpp

示例8: DoTransferAbility

    void DoTransferAbility()
    {
        for (GuidList::const_iterator itr = m_lAssistList.begin(); itr != m_lAssistList.end(); ++itr)
        {
            if (Creature* pBuddy = m_creature->GetMap()->GetCreature(*itr))
            {
                if (*itr == m_creature->GetObjectGuid())
                    continue;

                if (!pBuddy->isAlive())
                    continue;

                pBuddy->SetHealth(pBuddy->GetMaxHealth());
                DoCastSpellIfCan(pBuddy, m_uiMyAbility, CAST_TRIGGERED);
            }
        }
    }
开发者ID:BThallid,项目名称:mangos,代码行数:17,代码来源:mob_anubisath_sentinel.cpp

示例9: JustDied

    void JustDied(Unit* /*pKiller*/) override
    {
        if (!m_pInstance)
            return;

        m_pInstance->SetData(TYPE_GRUBBIS, FAIL);

        if (m_bSouthernCaveInOpened)                        // close southern cave-in door
            m_pInstance->DoUseDoorOrButton(GO_CAVE_IN_SOUTH);
        if (m_bNorthernCaveInOpened)                        // close northern cave-in door
            m_pInstance->DoUseDoorOrButton(GO_CAVE_IN_NORTH);

        for (GuidList::const_iterator itr = m_luiSummonedMobGUIDs.begin(); itr != m_luiSummonedMobGUIDs.end(); ++itr)
        {
            if (Creature* pSummoned = m_creature->GetMap()->GetCreature(*itr))
                pSummoned->ForcedDespawn();
        }
    }
开发者ID:natedahl32,项目名称:portalclassic,代码行数:18,代码来源:gnomeregan.cpp

示例10: JustDied

    void JustDied(Unit* /*pKiller*/) override
    {
        DoScriptText(SAY_DEATH, m_creature);

        if (m_pInstance)
        {
            m_pInstance->SetData(TYPE_TRIBUNAL, FAIL);
            // Continue at right state after respawn
            if (m_bHasContinued)
                m_pInstance->SetData(TYPE_TRIBUNAL, IN_PROGRESS);
        }

        for (GuidList::const_iterator itr = m_luiDwarfGUIDs.begin(); itr != m_luiDwarfGUIDs.end(); ++itr)
        {
            if (Creature* pDwarf = m_creature->GetMap()->GetCreature(*itr))
                pDwarf->ForcedDespawn();
        }
        m_luiDwarfGUIDs.clear();
    }
开发者ID:AwkwardDev,项目名称:mangos-d3,代码行数:19,代码来源:halls_of_stone.cpp

示例11: ReceiveAIEvent

        // Wrapper which sends each sphere in a different direction
        void ReceiveAIEvent(AIEventType eventType, Creature* /*sender*/, Unit* invoker, uint32 /**/) override
        {
            if (eventType != AI_EVENT_CUSTOM_A || invoker != m_creature)
                return;

            float fX, fY;
            uint8 uiIndex = m_bIsRegularMode ? urand(0, 2) : 0;
            for (GuidList::const_iterator itr = m_lFlameOrbsGuidList.begin(); itr != m_lFlameOrbsGuidList.end(); ++itr)
            {
                if (Creature* pOrb = m_creature->GetMap()->GetCreature(*itr))
                {
                    pOrb->CastSpell(pOrb, m_bIsRegularMode ? SPELL_FLAME_SPHERE_PERIODIC : SPELL_FLAME_SPHERE_PERIODIC_H, true);

                    pOrb->GetNearPoint2D(fX, fY, 70.0f, (2 * M_PI_F / 3)*uiIndex);
                    pOrb->GetMotionMaster()->MovePoint(0, fX, fY, pOrb->GetPositionZ());
                }
                ++uiIndex;
            }
        }
开发者ID:Chuck5ta,项目名称:ScriptDev3,代码行数:20,代码来源:boss_taldaram.cpp

示例12: DoHandleBeamHelpers

    // Wrapper to handle the blue beams animation
    void DoHandleBeamHelpers(bool bReset)
    {
        if (!m_pInstance)
            return;

        GuidList lBeamHelpersGuid;
        m_pInstance->GetBeamHelpersGUIDList(lBeamHelpersGuid);

        for (GuidList::const_iterator itr = lBeamHelpersGuid.begin(); itr != lBeamHelpersGuid.end(); ++itr)
        {
            if (Creature* pBeam = m_creature->GetMap()->GetCreature(*itr))
            {
                if (bReset)
                    pBeam->InterruptNonMeleeSpells(false);
                else
                    pBeam->CastSpell(m_creature, SPELL_BLUE_BEAM, TRIGGERED_NONE);
            }
        }
    }
开发者ID:Phatcat,项目名称:mangos-wotlk,代码行数:20,代码来源:boss_hydross_the_unstable.cpp

示例13: SummonAdds

    void SummonAdds(bool bRightSide, uint32 uiSummonEntry)
    {
        GuidList* plSummonPosGuids;
        switch(uiSummonEntry)
        {
            case NPC_UNREL_TRAINEE:      plSummonPosGuids = &m_lTraineeSummonPosGuids;     break;
            case NPC_UNREL_DEATH_KNIGHT: plSummonPosGuids = &m_lDeathKnightSummonPosGuids; break;
            case NPC_UNREL_RIDER:        plSummonPosGuids = &m_lRiderSummonPosGuids;       break;
            default:
                return;
        }
        if (plSummonPosGuids->empty())
            return;

        for (GuidList::iterator itr = plSummonPosGuids->begin(); itr != plSummonPosGuids->end(); ++itr)
        {
            if (Creature* pPos = m_creature->GetMap()->GetCreature(*itr))
                m_creature->SummonCreature(uiSummonEntry, pPos->GetPositionX(), pPos->GetPositionY(), pPos->GetPositionZ(), pPos->GetOrientation(), TEMPSUMMON_DEAD_DESPAWN, 0);
        }
    }
开发者ID:Sar777,项目名称:scriptdev2,代码行数:20,代码来源:boss_gothik.cpp

示例14: JustRespawned

    void JustRespawned() override
    {
        Reset();                                            // Needed to reset the flags properly

        GuidList lTeslaGUIDList;
        if (!m_pInstance)
            return;

        m_pInstance->GetThadTeslaCreatures(lTeslaGUIDList);
        if (lTeslaGUIDList.empty())
            return;

        for (GuidList::const_iterator itr = lTeslaGUIDList.begin(); itr != lTeslaGUIDList.end(); ++itr)
        {
            if (Creature* pTesla = m_pInstance->instance->GetCreature(*itr))
            {
                if (npc_tesla_coilAI* pTeslaAI = dynamic_cast<npc_tesla_coilAI*>(pTesla->AI()))
                    pTeslaAI->ReApplyChain(m_creature->GetEntry());
            }
        }
    }
开发者ID:Tafuna,项目名称:scriptdev2-tbc,代码行数:21,代码来源:boss_thaddius.cpp

示例15: SetData

        void SetData(uint32 uiType, uint32 /*uiData*/) override
        {
            switch (uiType)
            {
                case DATA_START:
                    DoSummonGrandChampion(uiFirstBoss);
                    NextStep(10000, false, 1);
                    break;
                case DATA_IN_POSITION: //movement done.
                    me->GetMotionMaster()->MovePoint(1, 735.81f, 661.92f, 412.39f);
                    if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_MAIN_GATE)))
                        instance->HandleGameObject(go->GetGUID(), false);
                    NextStep(10000, false, 3);
                    break;
                case DATA_LESSER_CHAMPIONS_DEFEATED:
                {
                    ++uiLesserChampions;
                    GuidList TempList;
                    if (uiLesserChampions == 3 || uiLesserChampions == 6)
                    {
                        switch (uiLesserChampions)
                        {
                            case 3:
                                TempList = Champion2List;
                                break;
                            case 6:
                                TempList = Champion3List;
                                break;
                        }

                        for (GuidList::const_iterator itr = TempList.begin(); itr != TempList.end(); ++itr)
                            if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
                                AggroAllPlayers(summon);
                    }else if (uiLesserChampions == 9)
                        StartGrandChampionsAttack();

                    break;
                }
            }
        }
开发者ID:AllThing,项目名称:TrinityCore,代码行数:40,代码来源:trial_of_the_champion.cpp


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