PkmnLib.NET/PkmnLib.Static/Libraries/MoveLibrary.cs

31 lines
918 B
C#

using System.Diagnostics.CodeAnalysis;
using PkmnLib.Static.Moves;
using PkmnLib.Static.Utils;
namespace PkmnLib.Static.Libraries;
/// <summary>
/// The library for all moves in the game.
/// </summary>
public interface IReadOnlyMoveLibrary : IEnumerable<IMoveData>
{
/// <summary>
/// Tries to get a move from the library. Returns false if the move is not found.
/// </summary>
bool TryGet(StringKey key, [MaybeNullWhen(false)] out IMoveData value);
/// <summary>
/// Gets a random move from the library.
/// </summary>
IMoveData GetRandom(IRandom random);
/// <summary>
/// The amount of moves in the library.
/// </summary>
int Count { get; }
/// <summary>
/// Whether the library is empty.
/// </summary>
bool IsEmpty { get; }
}
/// <inheritdoc cref="IReadOnlyMoveLibrary"/>
public class MoveLibrary : DataLibrary<IMoveData>, IReadOnlyMoveLibrary;