Add DungeonMapRandomizer

This commit is contained in:
2026-01-04 00:43:18 -06:00
parent 4c7022d8e7
commit a90286578c
10 changed files with 61 additions and 13 deletions

View File

@@ -64,6 +64,19 @@
}
}
}
public string GetRandomizerName(RandomizerInstance randomizer)
{
var fi = typeof(RandomizerInstance).GetField(randomizer.ToString(), BindingFlags.Static | BindingFlags.Public);
var randomizerKey = fi?.GetCustomAttribute<RandomizerNameAttribute>()?.Name;
if (randomizerKey == null) {
throw new InvalidSettingsException("Invalid randomizer: {0}", randomizerKey);
}
return randomizerKey;
}
}
public class SettingsLookupException : Exception {