// Token: 0x06004977 RID: 18807 RVA: 0x0016E56C File Offset: 0x0016C76C
        public bool IsTechLocked(int TechId)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_IsTechLockedInt32_hotfix != null)
            {
                return(Convert.ToBoolean(this.m_IsTechLockedInt32_hotfix.call(new object[]
                {
                    this,
                    TechId
                })));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            ConfigDataTrainingTechInfo configDataTrainingTechInfo = this.m_configDataLoader.GetConfigDataTrainingTechInfo(TechId);
            int          techMaxLevel = this.GetTechMaxLevel(TechId);
            TrainingTech tech         = this.GetTech(TechId);

            if (tech.Level >= techMaxLevel)
            {
                return(false);
            }
            TrainingTechInfo             TechInfo = configDataTrainingTechInfo.m_Infos[tech.Level];
            ConfigDataTrainingCourseInfo configDataTrainingCourseInfo = this.m_configDataLoader.GetConfigDataTrainingCourseInfo(configDataTrainingTechInfo.m_courseId);
            TrainingRoom room = this.GetRoom(configDataTrainingCourseInfo.RoomID);

            if (room.Level < TechInfo.RoomLevel)
            {
                return(true);
            }
            if (TechInfo.PreIds == null || TechInfo.PreIds.Count == 0)
            {
                return(false);
            }
            List <TrainingTech> availableTechs = this.GetAvailableTechs();
            int i;

            for (i = 0; i < TechInfo.PreIds.Count; i++)
            {
                int PreTechId = TechInfo.PreIds[i];
                if (availableTechs.Find((TrainingTech t) => t.ConfigId == PreTechId && !this.IsTechLocked(t.ConfigId) && t.Level >= TechInfo.PreTechLevels[i]) == null)
                {
                    return(true);
                }
            }
            return(false);
        }
Пример #2
0
        // Token: 0x06003CFC RID: 15612 RVA: 0x00113948 File Offset: 0x00111B48
        public void ReloadConfigData()
        {
            List <int> list = new List <int>();

            for (int i = this.Rooms.Count - 1; i >= 0; i--)
            {
                if (this.ConfigDataLoader.GetConfigDataTrainingRoomInfo(this.Rooms[i].ConfigId) == null)
                {
                    list.Add(i);
                }
            }
            foreach (int index in list)
            {
                this.Rooms.RemoveAt(index);
            }
            IEnumerable <KeyValuePair <int, ConfigDataTrainingRoomInfo> > allConfigDataTrainingRoomInfo = this.ConfigDataLoader.GetAllConfigDataTrainingRoomInfo();

            using (IEnumerator <KeyValuePair <int, ConfigDataTrainingRoomInfo> > enumerator2 = allConfigDataTrainingRoomInfo.GetEnumerator())
            {
                while (enumerator2.MoveNext())
                {
                    KeyValuePair <int, ConfigDataTrainingRoomInfo> kv = enumerator2.Current;
                    TrainingRoom trainingRoom = this.Rooms.Find((TrainingRoom r) => r.ConfigId == kv.Value.ID);
                    if (trainingRoom == null)
                    {
                        trainingRoom = new TrainingRoom
                        {
                            ConfigId = kv.Value.ID
                        };
                        this.Rooms.Add(trainingRoom);
                    }
                    trainingRoom.ConfigDataLoader    = this.ConfigDataLoader;
                    trainingRoom.WhichTrainingGround = this;
                }
            }
        }