Implements dataloading
This commit is contained in:
@@ -11,19 +11,19 @@ public interface IAbility : INamedValue
|
||||
/// The name of the script effect of the ability. This should refer to the name of the script that will be executed
|
||||
/// when the ability is triggered.
|
||||
/// </summary>
|
||||
StringKey Effect { get; }
|
||||
StringKey? Effect { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The parameters for the script effect of the ability.
|
||||
/// </summary>
|
||||
IReadOnlyDictionary<StringKey, object> Parameters { get; }
|
||||
IReadOnlyDictionary<StringKey, object?> Parameters { get; }
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public class AbilityImpl : IAbility
|
||||
{
|
||||
/// <inheritdoc cref="AbilityImpl" />
|
||||
public AbilityImpl(StringKey name, StringKey effect, IReadOnlyDictionary<StringKey, object> parameters)
|
||||
public AbilityImpl(StringKey name, StringKey? effect, IReadOnlyDictionary<StringKey, object?> parameters)
|
||||
{
|
||||
Name = name;
|
||||
Effect = effect;
|
||||
@@ -34,10 +34,10 @@ public class AbilityImpl : IAbility
|
||||
public StringKey Name { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public StringKey Effect { get; }
|
||||
public StringKey? Effect { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public IReadOnlyDictionary<StringKey, object> Parameters { get; }
|
||||
public IReadOnlyDictionary<StringKey, object?> Parameters { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -21,7 +21,7 @@ public record LevelEvolution : IEvolution
|
||||
/// <summary>
|
||||
/// The level at which the Pokémon evolves.
|
||||
/// </summary>
|
||||
public required uint Level { get; init; }
|
||||
public required LevelInt Level { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public required StringKey ToSpecies { get; init; }
|
||||
@@ -35,7 +35,7 @@ public record LevelGenderEvolution : IEvolution
|
||||
/// <summary>
|
||||
/// The level at which the Pokémon evolves.
|
||||
/// </summary>
|
||||
public required uint Level { get; init; }
|
||||
public required LevelInt Level { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// The gender the Pokémon needs to have to evolve
|
||||
@@ -227,7 +227,7 @@ public record CustomEvolution : IEvolution
|
||||
/// <summary>
|
||||
/// The parameters of the custom evolution method.
|
||||
/// </summary>
|
||||
public required IReadOnlyDictionary<StringKey, object> Parameters { get; init; }
|
||||
public required IReadOnlyDictionary<StringKey, object?> Parameters { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public required StringKey ToSpecies { get; init; }
|
||||
|
||||
@@ -114,8 +114,6 @@ public class FormImpl : IForm
|
||||
throw new ArgumentException("A form must have at least one type.");
|
||||
if (Abilities.Count == 0)
|
||||
throw new ArgumentException("A form must have at least one ability.");
|
||||
if (HiddenAbilities.Count == 0)
|
||||
throw new ArgumentException("A form must have at least one hidden ability.");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
Reference in New Issue
Block a user