More abilities, implemented support for form inheritance
All checks were successful
Build / Build (push) Successful in 49s

This commit is contained in:
2025-06-13 12:24:03 +02:00
parent 6d71de375e
commit 8363b955af
16 changed files with 504 additions and 11 deletions

View File

@@ -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();