using System.Diagnostics.CodeAnalysis; using PkmnLib.Static.Utils; namespace PkmnLib.Static.Libraries; /// /// The library for all items in the game. /// public interface IReadOnlyItemLibrary : IEnumerable { /// /// Tries to get an item from the library. Returns false if the item is not found. /// bool TryGet(StringKey key, [MaybeNullWhen(false)] out IItem value); /// /// Gets a random item from the library. /// IItem GetRandom(IRandom random); /// /// The amount of items in the library. /// int Count { get; } /// /// Whether the library is empty. /// bool IsEmpty { get; } } /// public class ItemLibrary : DataLibrary, IReadOnlyItemLibrary;