More abilities, implemented support for form inheritance
All checks were successful
Build / Build (push) Successful in 49s
All checks were successful
Build / Build (push) Successful in 49s
This commit is contained in:
@@ -76,6 +76,20 @@ public static class SpeciesDataLoader
|
||||
$"Egg cycles for species {id} is invalid: {serialized.EggCycles}. Must be greater than or equal to 0.");
|
||||
}
|
||||
|
||||
foreach (var form in serialized.Formes)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(form.Value.InheritFrom))
|
||||
{
|
||||
var inheritedForm = serialized.Formes.GetValueOrDefault(form.Value.InheritFrom);
|
||||
if (inheritedForm == null)
|
||||
{
|
||||
throw new InvalidDataException(
|
||||
$"Form {form.Key} inherits from {form.Value.InheritFrom}, but that form does not exist.");
|
||||
}
|
||||
form.Value.MakeInheritFrom(inheritedForm);
|
||||
}
|
||||
}
|
||||
|
||||
var forms = serialized.Formes.ToDictionary(x => (StringKey)x.Key,
|
||||
x => DeserializeForm(x.Key, x.Value, typeLibrary));
|
||||
var evolutions = serialized.Evolutions.Select(DeserializeEvolution).ToList();
|
||||
|
||||
Reference in New Issue
Block a user