Add player slot to settings object

This commit is contained in:
2026-05-25 21:17:42 -05:00
parent e7f101ddee
commit e173ae8056
4 changed files with 10 additions and 6 deletions

View File

@@ -59,6 +59,7 @@
}
internal class IgnoreSettingAttribute : RandomizerSpecificAttribute {
public IgnoreSettingAttribute() : base(null) { }
public IgnoreSettingAttribute(params RandomizerInstance[] randomizers) : base(randomizers) { }
}

View File

@@ -10,7 +10,7 @@
var props = typeof(SeedSettings).GetProperties(BindingFlags.Instance | BindingFlags.Public);
var starting = new List<string>();
foreach (var prop in props) {
if (prop.Name == nameof(SeedSettings.PlayerName)) {
if (prop.GetCustomAttributes<IgnoreSettingAttribute>().Any(att => att.HasRandomizer(randomizer))) {
continue;
}
@@ -19,10 +19,6 @@
var fi = prop.PropertyType.GetField(valueFieldName, BindingFlags.Static | BindingFlags.Public)
?? throw new SettingsLookupException("Could not get field info for value {0}.{1}", prop.PropertyType, valueFieldName);
if (prop.GetCustomAttributes<IgnoreSettingAttribute>().Any(att => att.HasRandomizer(randomizer))) {
continue;
}
if (!prop.GetCustomAttributes<NoSettingNameAttribute>().Any(att => att.HasRandomizer(randomizer))) {
var settingName =
prop.GetCustomAttributes<SettingNameAttribute>()