Skip to content

Commit

Permalink
review deprecated logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ThyWoof committed Jan 29, 2024
1 parent 6706d21 commit cab37db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions SolastaUnfinishedBusiness/Models/SubclassesContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ private static Dictionary<CharacterSubclassDefinition, FeatureDefinitionSubclass
get;
} = [];

private static List<string> DeprecatedSubsList { get; } =
private static IEnumerable<string> DeprecatedSubsList { get; } =
[
"CollegeOfHarlequin",
"MartialMarshal",
Expand All @@ -40,13 +40,13 @@ internal static void Load()
RegisterClassesContext();

var finalDeprecatedList =
DeprecatedSubsList.RemoveAll(x => Main.Settings.DeprecatedSubsReenableList.Contains(x));
DeprecatedSubsList.Where(x => !Main.Settings.DeprecatedSubsReenableList.Contains(x));

foreach (var abstractSubClassInstance in typeof(AbstractSubclass)
.Assembly.GetTypes()
.Where(t => t.IsSubclassOf(typeof(AbstractSubclass)) && !t.IsAbstract)
.Select(t => (AbstractSubclass)Activator.CreateInstance(t))
.Where(t => !DeprecatedSubsList.Contains(t.Subclass.Name)))
.Where(t => !finalDeprecatedList.Contains(t.Subclass.Name)))
{
LoadSubclass(abstractSubClassInstance);
}
Expand Down
2 changes: 1 addition & 1 deletion SolastaUnfinishedBusiness/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class Settings : UnityModManager.ModSettings
public bool DisableStreamlinedMultiLevelUp { get; set; } = true;

// change this at your own risk as these subclasses will be fully removed from mod in the near future
public List<string> DeprecatedSubsReenableList { get; set; }
public List<string> DeprecatedSubsReenableList { get; set; } = [];

public HashSet<String> MonstersThatShouldHaveDarkvision { get; set; } =
[
Expand Down

0 comments on commit cab37db

Please sign in to comment.