Exemple #1
0
        public void Tick()
        {
            bool refresh = false;

            for (int i = 0; i < this.m_missions.Size(); i++)
            {
                LogicMission mission = this.m_missions[i];

                if (mission != null)
                {
                    mission.RefreshProgress();

                    if (mission.IsFinished())
                    {
                        this.m_missions.Remove(i--);

                        mission.Destruct();
                        refresh = true;
                    }
                    else
                    {
                        mission.Tick();
                    }
                }
            }

            if (refresh)
            {
                this.RefreshOpenMissions();
            }
        }
Exemple #2
0
        public LogicMission GetMissionByData(LogicMissionData data)
        {
            for (int i = 0; i < this.m_missions.Size(); i++)
            {
                LogicMission mission = this.m_missions[i];

                if (mission.GetMissionData() == data)
                {
                    return(mission);
                }
            }

            return(null);
        }
Exemple #3
0
        public LogicMission GetMissionByCategory(int category)
        {
            for (int i = 0; i < this.m_missions.Size(); i++)
            {
                LogicMission mission = this.m_missions[i];

                if (mission.GetMissionData().GetMissionCategory() == category)
                {
                    return(mission);
                }
            }

            return(null);
        }
Exemple #4
0
        public void RefreshOpenMissions()
        {
            if (this.m_level.GetState() != 4)
            {
                LogicClientAvatar playerAvatar = this.m_level.GetPlayerAvatar();
                LogicDataTable    missionTable = LogicDataTables.GetTable(LogicDataType.MISSION);

                for (int i = 0; i < missionTable.GetItemCount(); i++)
                {
                    LogicMissionData missionData = (LogicMissionData)missionTable.GetItemAt(i);

                    if (missionData.IsOpenForAvatar(playerAvatar))
                    {
                        if (this.GetMissionByData(missionData) == null)
                        {
                            LogicMission mission = new LogicMission(missionData, this.m_level);
                            mission.RefreshProgress();
                            this.m_missions.Add(mission);
                        }
                    }
                }
            }
        }