34 lines
949 B
C#
34 lines
949 B
C#
using System.Diagnostics.CodeAnalysis;
|
|
using PkmnLib.Static.Species;
|
|
using PkmnLib.Static.Utils;
|
|
|
|
namespace PkmnLib.Static.Libraries;
|
|
|
|
/// <summary>
|
|
/// The library for all abilities in the game.
|
|
/// </summary>
|
|
public interface IReadOnlyAbilityLibrary : IEnumerable<IAbility>
|
|
{
|
|
/// <summary>
|
|
/// Tries to get an ability from the library. Returns false if the ability is not found.
|
|
/// </summary>
|
|
bool TryGet(StringKey key, [MaybeNullWhen(false)] out IAbility value);
|
|
|
|
/// <summary>
|
|
/// Gets a random ability from the library.
|
|
/// </summary>
|
|
IAbility GetRandom(IRandom random);
|
|
|
|
/// <summary>
|
|
/// The amount of abilities in the library.
|
|
/// </summary>
|
|
int Count { get; }
|
|
|
|
/// <summary>
|
|
/// Whether the library is empty.
|
|
/// </summary>
|
|
bool IsEmpty { get; }
|
|
}
|
|
|
|
/// <inheritdoc cref="IReadOnlyAbilityLibrary"/>
|
|
public class AbilityLibrary : DataLibrary<IAbility>, IReadOnlyAbilityLibrary; |