當前位置: 首頁>>代碼示例>>C++>>正文


C++ EncounterState函數代碼示例

本文整理匯總了C++中EncounterState函數的典型用法代碼示例。如果您正苦於以下問題:C++ EncounterState函數的具體用法?C++ EncounterState怎麽用?C++ EncounterState使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了EncounterState函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: Load

        void Load(const char* data)
        {
            if (!data)
            {
                OUT_LOAD_INST_DATA_FAIL;
                return;
            }

            OUT_LOAD_INST_DATA(data);

            char dataHead1, dataHead2;
            uint16 data0;

            std::istringstream loadStream(data);
            loadStream >> dataHead1 >> dataHead2 >> data0;

            if (dataHead1 == 'E' && dataHead2 == 'E')
            {
                if (data0 == IN_PROGRESS || data0 > SPECIAL)
                    data0 = NOT_STARTED;

                SetBossState(BOSS_MALYGOS, EncounterState(data0));
            }
            else
                OUT_LOAD_INST_DATA_FAIL;

            OUT_LOAD_INST_DATA_COMPLETE;
        }
開發者ID:Firearm,項目名稱:TrinityCore,代碼行數:28,代碼來源:instance_eye_of_eternity.cpp

示例2: Load

        void Load(const char * str)
        {
            if (!str)
            {
                OUT_LOAD_INST_DATA_FAIL;
                return;
            }

            OUT_LOAD_INST_DATA(str);

            char dataHead1, dataHead2;

            std::istringstream loadStream(str);
            loadStream >> dataHead1 >> dataHead2;

            if(dataHead1 == 'N' && dataHead2 == 'X')
            {
                for(int i = 0; i < MAX_BOSS_NUMBER; ++i)
                {
                    uint32 tmpState;
                    loadStream >> tmpState;
                    if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
                        tmpState = NOT_STARTED;
                    SetBossState(i, EncounterState(tmpState));
                }
                loadStream >> PlayerDeathCount >> HeiganPlayerDeathCount;
            }
            else
開發者ID:aedansilver,項目名稱:CzechFunCore,代碼行數:28,代碼來源:instance_naxxramas.cpp

示例3: Load

            void Load(char const* str)
            {
                if (!str)
                {
                    OUT_LOAD_INST_DATA_FAIL;
                    return;
                }

                OUT_LOAD_INST_DATA(str);

                char dataHead1, dataHead2;

                std::istringstream loadStream(str);
                loadStream >> dataHead1 >> dataHead2;

                if (dataHead1 == 'R' && dataHead2 == 'S')
                {
                    for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
                    {
                        uint32 tmpState;
                        loadStream >> tmpState;
                        if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
                            tmpState = NOT_STARTED;

                        SetBossState(i, EncounterState(tmpState));
                    }

					// Xinef: additional check
					if (GetBossState(DATA_HALION_INTRO_DONE) != DONE)
					{
						SetBossState(DATA_HALION_INTRO1, NOT_STARTED);
						SetBossState(DATA_HALION_INTRO2, NOT_STARTED);
					}
                }
                else
開發者ID:DSlayerMan,項目名稱:Sunwell,代碼行數:35,代碼來源:instance_ruby_sanctum.cpp

示例4: Load

            void Load(char const* str) 
            {
                if (!str)
                {
                    OUT_LOAD_INST_DATA_FAIL;
                    return;
                }

                OUT_LOAD_INST_DATA(str);

                char dataHead1, dataHead2;

                std::istringstream loadStream(str);
                loadStream >> dataHead1 >> dataHead2;

                if (dataHead1 == 'S' && dataHead2 == 'L')
                {
                    for (uint32 i = 0; i < EncounterCount; ++i)
                    {
                        uint32 tmpState;
                        loadStream >> tmpState;
                        if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
                            tmpState = NOT_STARTED;
                        SetBossState(i, EncounterState(tmpState));
                    }
                }
                else
開發者ID:AwkwardDev,項目名稱:WoWSource434,代碼行數:27,代碼來源:instance_shadow_labyrinth.cpp

示例5: Load

            void Load(const char* strIn)
            {
                if (!strIn)
                {
                    OUT_LOAD_INST_DATA_FAIL;
                    return;
                }

                OUT_LOAD_INST_DATA(strIn);

                char dataHead1, dataHead2;

                std::istringstream loadStream(strIn);
                loadStream >> dataHead1 >> dataHead2;

                if (dataHead1 == 'S' && dataHead2 == 'H')
                {
                    for (uint8 i = 0; i < ENCOUNTER_COUNT; ++i)
                    {
                        uint32 tmpState;
                        loadStream >> tmpState;
                        if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
                            tmpState = NOT_STARTED;
                        SetBossState(i, EncounterState(tmpState));
                    }

					loadStream >> RescueTimer;
                }
                else
開發者ID:AlexHjelm,項目名稱:sunwell,代碼行數:29,代碼來源:instance_shattered_halls.cpp

示例6: Load

            void Load(const char* strIn) override
            {
                if (!strIn)
                {
                    OUT_LOAD_INST_DATA_FAIL;
                    return;
                }

                OUT_LOAD_INST_DATA(strIn);

                char dataHead1, dataHead2;

                std::istringstream loadStream(strIn);
                loadStream >> dataHead1 >> dataHead2;

                if (dataHead1 == 'N' && dataHead2 == 'X')
                {
                    for (uint8 i = 0; i < EncounterCount; ++i)
                    {
                        uint32 tmpState;
                        loadStream >> tmpState;
                        if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
                            tmpState = NOT_STARTED;

                        SetBossState(i, EncounterState(tmpState));
                    }

                    loadStream >> playerDied;
                }

                OUT_LOAD_INST_DATA_COMPLETE;
            }
開發者ID:Caydan,項目名稱:WoWSCore548,代碼行數:32,代碼來源:instance_naxxramas.cpp

示例7: Load

            void Load(const char* in)
            {
                if (!in)
                {
                    OUT_LOAD_INST_DATA_FAIL;
                    return;
                }

                OUT_LOAD_INST_DATA(in);

                char dataHead1, dataHead2;

                std::istringstream loadStream(in);
                loadStream >> dataHead1 >> dataHead2;

                if (dataHead1 == 'V' && dataHead2 == 'P')
                {
                    for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
                    {
                        uint32 tmpState;
                        loadStream >> tmpState;
                        if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
                            tmpState = NOT_STARTED;
                        SetBossState(i, EncounterState(tmpState));
                    }
                }
                else OUT_LOAD_INST_DATA_FAIL;
開發者ID:Lbniese,項目名稱:WoWCircle434,代碼行數:27,代碼來源:instance_the_vortex_pinnacle.cpp

示例8: Load

        void Load(const char* strIn)
        {
            if (!strIn)
            {
                OUT_LOAD_INST_DATA_FAIL;
                return;
            }

            OUT_LOAD_INST_DATA(strIn);

            char dataHead1, dataHead2;

            std::istringstream loadStream(strIn);
            loadStream >> dataHead1 >> dataHead2;

            if (dataHead1 == 'U' && dataHead2 == 'U')
            {
                for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
                {
                    uint32 tmpState;
                    loadStream >> tmpState;
                    if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
                        tmpState = NOT_STARTED;

                    if (i == TYPE_COLOSSUS)
                        SetData(i, tmpState);
                    else
                        SetBossState(i, EncounterState(tmpState));
                }
            }

            OUT_LOAD_INST_DATA_COMPLETE;
        }
開發者ID:blluey,項目名稱:TrinityCore,代碼行數:33,代碼來源:instance_ulduar.cpp

示例9: SetData

            void SetData(uint32 type, uint32 data)
            {
                SetBossState(type, EncounterState(data));

                if (data == DONE)
                    SaveToDB();
            }
開發者ID:PavelDev,項目名稱:Core,代碼行數:7,代碼來源:instance_stormstout_brewery.cpp

示例10: SetData

 void SetData(uint32 type, uint32 data) override
 {
     switch (type)
     {
         case DATA_HANDLE_CORBORUS_ROCKDOOR:
             HandleGameObject(corborusRockDoorGUID, true);
             break;
         case DATA_MILLHOUSE_EVENT_FACE:
             MillhouseEvent_Face();
             break;
         case DATA_MILLHOUSE_EVENT_KNOCKBACK:
             MillhouseEvent_Knockback();
             break;
         case DATA_MILLHOUSE_EVENT_DESPAWN:
             MillhouseEvent_Despawn();
             break;
         case DATA_SLABHIDE_INTRO:
             slabhideIntro = EncounterState(data);
             break;
         case DATA_SLABHIDE_ROCK_WALL: // Handles rock walls
             for (std::vector<ObjectGuid>::iterator itr = slabhideRockWallGUIDs.begin(); itr != slabhideRockWallGUIDs.end(); ++itr)
                 HandleGameObject((*itr), data ? true : false);
             break;
         default:
             break;
     }
 }
開發者ID:Diyvol,項目名稱:TrinityCore,代碼行數:27,代碼來源:instance_stonecore.cpp

示例11: Load

            void Load(const char* str)
            {
                if (!str)
                {
                    OUT_LOAD_INST_DATA_FAIL;
                    return;
                }

                OUT_LOAD_INST_DATA(str);

                char dataHead1, dataHead2;

                std::istringstream loadStream(str);
                loadStream >> dataHead1 >> dataHead2;

                if (dataHead1 == 'M' && dataHead2 == 'E')
                {
                    for (uint32 i = 0; i < MAX_ENCOUNTER; ++i)
                    {
                        uint32 tmpState;
                        loadStream >> tmpState;
                        if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
                            tmpState = NOT_STARTED;
                        SetBossState(i, EncounterState(tmpState));
                    }

					loadStream >> _passageEncounter;
					if (_passageEncounter == ENCOUNTER_PASSAGE_DONE)
						_passageEncounter = ENCOUNTER_PASSAGE_PHASE6;
                }
                else
開發者ID:DSlayerMan,項目名稱:Sunwell,代碼行數:31,代碼來源:instance_mechanar.cpp

示例12: Load

            void Load(const char* strIn) override
            {
                if (!strIn)
                {
                    OUT_LOAD_INST_DATA_FAIL;
                    return;
                }

                OUT_LOAD_INST_DATA(strIn);

                std::istringstream loadStream(strIn);

                for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
                {
                    uint32 tmpState;
                    loadStream >> tmpState;
                    if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
                        tmpState = NOT_STARTED;
                    SetBossState(i, EncounterState(tmpState));
                }

                loadStream >> TrialCounter;
                EventStage = 0;

                OUT_LOAD_INST_DATA_COMPLETE;
            }
開發者ID:mysql1,項目名稱:TournamentCore,代碼行數:26,代碼來源:instance_trial_of_the_crusader.cpp

示例13: Load

            void Load(char const* strIn)
            {
                if (!strIn)
                {
                    OUT_LOAD_INST_DATA_FAIL;
                    return;
                }

                OUT_LOAD_INST_DATA(strIn);

                char dataHead1, dataHead2;

                std::istringstream loadStream(strIn);
                loadStream >> dataHead1 >> dataHead2;

                if (dataHead1 == 'U' && dataHead2 == 'U')
                {
                    for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
                    {
                        uint32 tmpState;
                        loadStream >> tmpState;
                        if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
                            tmpState = NOT_STARTED;

                        SetBossState(i, EncounterState(tmpState));
                    }

                    uint32 tempState;
                    loadStream >> tempState;
                    if (tempState == IN_PROGRESS || tempState > SPECIAL)
                        tempState = NOT_STARTED;
                    SetData(DATA_COLOSSUS, tempState);

                    loadStream >> _algalonTimer;
                    loadStream >> tempState;
                    _algalonSummoned = tempState != 0;
                    if (_algalonSummoned && GetBossState(BOSS_ALGALON) != DONE)
                    {
                        _summonAlgalon = true;
                        if (_algalonTimer && _algalonTimer <= 60)
                        {
                            _events.ScheduleEvent(EVENT_UPDATE_ALGALON_TIMER, 60000);
                            DoUpdateWorldState(WORLD_STATE_ALGALON_TIMER_ENABLED, 1);
                            DoUpdateWorldState(WORLD_STATE_ALGALON_DESPAWN_TIMER, _algalonTimer);
                        }
                    }
                }

                OUT_LOAD_INST_DATA_COMPLETE;
            }
開發者ID:FirstCore,項目名稱:GaryMoveOut_4.3.4,代碼行數:50,代碼來源:instance_ulduar.cpp

示例14: SetBossState

void InstanceScript::ReadSaveDataBossStates(std::istringstream& data)
{
    uint32 bossId = 0;
    for (std::vector<BossInfo>::iterator i = bosses.begin(); i != bosses.end(); ++i, ++bossId)
    {
        uint32 buff;
        data >> buff;
        if (buff == IN_PROGRESS || buff == SPECIAL)
            buff = NOT_STARTED;

        if (buff < TO_BE_DECIDED)
            SetBossState(bossId, EncounterState(buff));
    }
}
開發者ID:Archarean,項目名稱:TrinityCore,代碼行數:14,代碼來源:InstanceScript.cpp

示例15: Load

        void Load(const char* strIn)
        {
            if (!strIn)
            {
                OUT_LOAD_INST_DATA_FAIL;
                return;
            }

            OUT_LOAD_INST_DATA(strIn);

            char dataHead1, dataHead2;
            uint32 data1,data2,data3;

            std::istringstream loadStream(strIn);
            loadStream >> dataHead1 >> dataHead2;

            if (dataHead1 == 'U' && dataHead2 == 'U')
            {
                for (uint8 i = 0; i <= MAX_ENCOUNTER; ++i)
                {
                    uint32 tmpState;
                    loadStream >> tmpState;
                    if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
                        tmpState = NOT_STARTED;

                    SetBossState(i, EncounterState(tmpState));

                    // needed because of custom GetBossState(uint32 type) ?
                    uiEncounter[i] = tmpState;
                }
                uint32 tmpState, tmpState2;
                loadStream >> tmpState >> tmpState2;

                ColossusData = tmpState;
                uiPlayerDeathFlag = tmpState2;

                loadStream >> data1;
                loadStream >> data2;
                loadStream >> data3;

                SetData(DATA_ALGALON_INTRO, data1);
                SignalTimerState = data2;
                SignalTimerMinutes = data3;
            }

            OUT_LOAD_INST_DATA_COMPLETE;
        }
開發者ID:Expecto,項目名稱:chaoscore,代碼行數:47,代碼來源:instance_ulduar.cpp


注:本文中的EncounterState函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。