public bool SelectDefaultClassBuild() { if (!this.HasNextLevelPlan) { return(false); } if (!this.State.IsFirstLevel) { this.RemoveAction <SelectClass>(null); bool flag = this.ApplyLevelUpPlan(true); if (flag) { this.m_PlanChanged = false; this.UpdateDifficulty(); return(true); } return(false); } else { if (this.State.SelectedClass == null) { return(false); } BlueprintUnitFact defaultBuild = this.State.SelectedClass.DefaultBuild; if (defaultBuild == null) { return(false); } BlueprintRace race = this.Preview.Progression.Race; if (race == null || this.State.CanSelectRace) { return(false); } bool result; try { using (new DefaultBuildData(race)) { this.Unit.Ensure <LevelUpPlanUnitHolder>(); this.Unit.Progression.DropLevelPlans(); this.Unit.AddFact(defaultBuild, null, null); LevelPlanData levelPlan = this.Unit.Progression.GetLevelPlan(this.State.NextLevel); if (levelPlan == null) { result = false; } else { this.m_RecalculatePreview = true; this.LevelUpActions.RemoveAll((ILevelUpAction a) => TestLevelUpController.IsDefaultBuildPriority(a.Priority)); this.LevelUpActions.AddRange(from a in levelPlan.Actions where TestLevelUpController.IsDefaultBuildPriority(a.Priority) select a); this.LevelUpActions = (from a in this.LevelUpActions orderby a.Priority select a).ToList <ILevelUpAction>(); this.UpdatePreview(); this.m_HasPlan = true; this.m_PlanChanged = false; this.UpdateDifficulty(); result = true; } } } finally { this.Unit.RemoveFact(defaultBuild); this.Unit.Remove <LevelUpPlanUnitHolder>(); } return(result); } }