Initial commit
This commit is contained in:
63
PkmnLib.Static/Species/Ability.cs
Normal file
63
PkmnLib.Static/Species/Ability.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Static.Species;
|
||||
|
||||
/// <summary>
|
||||
/// An ability is a passive effect in battle that is attached to a Pokemon.
|
||||
/// </summary>
|
||||
public interface IAbility
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the ability.
|
||||
/// </summary>
|
||||
StringKey Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 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; }
|
||||
|
||||
/// <summary>
|
||||
/// The parameters for the script effect of the ability.
|
||||
/// </summary>
|
||||
IReadOnlyDictionary<StringKey, object> Parameters { get; }
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public class AbilityImpl : IAbility
|
||||
{
|
||||
/// <inheritdoc cref="AbilityImpl" />
|
||||
public AbilityImpl(StringKey name, StringKey effect, IReadOnlyDictionary<StringKey, object> parameters)
|
||||
{
|
||||
Name = name;
|
||||
Effect = effect;
|
||||
Parameters = parameters;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public StringKey Name { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public StringKey Effect { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public IReadOnlyDictionary<StringKey, object> Parameters { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An ability index allows us to find an ability on a form. It combines a bool for whether the
|
||||
/// ability is hidden or not, and then an index of the ability.
|
||||
/// </summary>
|
||||
public readonly record struct AbilityIndex
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether the ability we're referring to is a hidden ability.
|
||||
/// </summary>
|
||||
public required bool IsHidden { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// The index of the ability.
|
||||
/// </summary>
|
||||
public required byte Index { get; init; }
|
||||
}
|
||||
Reference in New Issue
Block a user