// Token: 0x0600497E RID: 18814 RVA: 0x0016ED68 File Offset: 0x0016CF68
        public void ApplyTrainingTechToHero(Hero hero, TrainingTech tech)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_ApplyTrainingTechToHeroHeroTrainingTech_hotfix != null)
            {
                this.m_ApplyTrainingTechToHeroHeroTrainingTech_hotfix.call(new object[]
                {
                    this,
                    hero,
                    tech
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            if (tech == null || tech.Level == 0)
            {
                return;
            }
            ConfigDataHeroInfo configDataHeroInfo = this.m_configDataLoader.GetConfigDataHeroInfo(hero.HeroId);

            if (configDataHeroInfo == null)
            {
                return;
            }
            TrainingTechInfo trainingTechInfo = tech.Infos[tech.Level - 1];

            if (configDataHeroInfo.TechCanLearnSoldiers_ID.Contains(trainingTechInfo.SoldierIDUnlocked) && !hero.HasOwnSoldier(trainingTechInfo.SoldierIDUnlocked))
            {
                this.m_hero.AddSoldier(hero, trainingTechInfo.SoldierIDUnlocked, true);
            }
        }
    public static int get_TechID(IntPtr l)
    {
        int result;

        try
        {
            TrainingTechInfo trainingTechInfo = (TrainingTechInfo)LuaObject.checkSelf(l);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, trainingTechInfo.TechID);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int constructor(IntPtr l)
    {
        int result;

        try
        {
            TrainingTechInfo o = new TrainingTechInfo();
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, o);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
        // 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);
        }
    public static int set_ID(IntPtr l)
    {
        int result;

        try
        {
            TrainingTechInfo trainingTechInfo = (TrainingTechInfo)LuaObject.checkSelf(l);
            int id;
            LuaObject.checkType(l, 2, out id);
            trainingTechInfo.ID = id;
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int set_Config(IntPtr l)
    {
        int result;

        try
        {
            TrainingTechInfo trainingTechInfo = (TrainingTechInfo)LuaObject.checkSelf(l);
            ConfigDataTrainingTechLevelInfo config;
            LuaObject.checkType <ConfigDataTrainingTechLevelInfo>(l, 2, out config);
            trainingTechInfo.Config = config;
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int set_PreTechLevels(IntPtr l)
    {
        int result;

        try
        {
            TrainingTechInfo trainingTechInfo = (TrainingTechInfo)LuaObject.checkSelf(l);
            List <int>       preTechLevels;
            LuaObject.checkType <List <int> >(l, 2, out preTechLevels);
            trainingTechInfo.PreTechLevels = preTechLevels;
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int set_Materials(IntPtr l)
    {
        int result;

        try
        {
            TrainingTechInfo trainingTechInfo = (TrainingTechInfo)LuaObject.checkSelf(l);
            List <Goods>     materials;
            LuaObject.checkType <List <Goods> >(l, 2, out materials);
            trainingTechInfo.Materials = materials;
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int set_SoldierSkillLevelup(IntPtr l)
    {
        int result;

        try
        {
            TrainingTechInfo trainingTechInfo = (TrainingTechInfo)LuaObject.checkSelf(l);
            int soldierSkillLevelup;
            LuaObject.checkType(l, 2, out soldierSkillLevelup);
            trainingTechInfo.SoldierSkillLevelup = soldierSkillLevelup;
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }