More moves implemented

This commit is contained in:
2025-02-03 11:40:26 +01:00
parent 0c5ca487d7
commit 51dfc4d07e
40 changed files with 639 additions and 65 deletions

View File

@@ -1,3 +1,4 @@
using System.Collections.Immutable;
using PkmnLib.Static.Utils;
namespace PkmnLib.Static.Species;
@@ -17,17 +18,20 @@ public interface IAbility : INamedValue
/// The parameters for the script effect of the ability.
/// </summary>
IReadOnlyDictionary<StringKey, object?> Parameters { get; }
bool HasFlag(StringKey key);
}
/// <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, ImmutableHashSet<StringKey> flags)
{
Name = name;
Effect = effect;
Parameters = parameters;
Flags = flags;
}
/// <inheritdoc />
@@ -38,6 +42,14 @@ public class AbilityImpl : IAbility
/// <inheritdoc />
public IReadOnlyDictionary<StringKey, object?> Parameters { get; }
public ImmutableHashSet<StringKey> Flags;
/// <inheritdoc />
public bool HasFlag(StringKey key)
{
return Flags.Contains(key);
}
}
/// <summary>