Further work on static side

This commit is contained in:
Deukhoofd committed 2024-07-20 16:12:39 +02:00
1 parent 3845f91601
commit 1b501dee7e
29 files changed
+670 -155

No files matched your search

@@ -0,0 +1,34 @@
using System.Diagnostics.CodeAnalysis;
using PkmnLib.Static.Species;
using PkmnLib.Static.Utils;
namespace PkmnLib.Static.Libraries;
/// <summary>
/// The library for all species in the game.
/// </summary>
public interface IReadOnlySpeciesLibrary
{
/// <summary>
/// Tries to get a species from the library. Returns false if the species is not found.
/// </summary>
bool TryGet(StringKey key, [MaybeNullWhen(false)] out ISpecies value);
/// <summary>
/// Gets a random species from the library.
/// </summary>
ISpecies GetRandom(IRandom random);
/// <summary>
/// The amount of species in the library.
/// </summary>
int Count { get; }
/// <summary>
/// Whether the library is empty.
/// </summary>
bool IsEmpty { get; }
}
/// <inheritdoc cref="IReadOnlySpeciesLibrary"/>
public class SpeciesLibrary : DataLibrary<ISpecies>, IReadOnlySpeciesLibrary;