Adds egggroups
This commit is contained in:
@@ -70,6 +70,8 @@ public interface ISpecies : INamedValue
|
||||
/// The data regarding into which Pokémon this species can evolve, and how.
|
||||
/// </summary>
|
||||
IReadOnlyList<IEvolution> EvolutionData { get; }
|
||||
|
||||
ICollection<StringKey> EggGroups { get; }
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -77,8 +79,8 @@ public class SpeciesImpl : ISpecies
|
||||
{
|
||||
/// <inheritdoc cref="SpeciesImpl" />
|
||||
public SpeciesImpl(ushort id, StringKey name, float genderRate, StringKey growthRate, byte captureRate,
|
||||
byte baseHappiness, IReadOnlyDictionary<StringKey, IForm> forms, ImmutableHashSet<StringKey> flags,
|
||||
IReadOnlyList<IEvolution> evolutionData)
|
||||
byte baseHappiness, IReadOnlyDictionary<StringKey, IForm> forms, IEnumerable<StringKey> flags,
|
||||
IReadOnlyList<IEvolution> evolutionData, IEnumerable<StringKey> eggGroups)
|
||||
{
|
||||
Id = id;
|
||||
Name = name;
|
||||
@@ -87,8 +89,9 @@ public class SpeciesImpl : ISpecies
|
||||
CaptureRate = captureRate;
|
||||
BaseHappiness = baseHappiness;
|
||||
Forms = forms;
|
||||
Flags = flags;
|
||||
Flags = flags.ToImmutableHashSet();
|
||||
EvolutionData = evolutionData;
|
||||
EggGroups = eggGroups.ToImmutableHashSet();
|
||||
if (Forms.Count == 0)
|
||||
throw new ArgumentException("Species must have at least one form.");
|
||||
if (!Forms.ContainsKey("default"))
|
||||
@@ -122,6 +125,9 @@ public class SpeciesImpl : ISpecies
|
||||
/// <inheritdoc />
|
||||
public IReadOnlyList<IEvolution> EvolutionData { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public ICollection<StringKey> EggGroups { get; }
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool TryGetForm(StringKey id, [MaybeNullWhen(false)] out IForm form) => Forms.TryGetValue(id, out form);
|
||||
|
||||
Reference in New Issue
Block a user