PKHeX/PKHeX.Core/PKM/HOME/IHomeStorage.cs

32 lines
965 B
C#
Raw Normal View History

namespace PKHeX.Core;
2023-07-09 21:10:40 +00:00
/// <summary>
/// Interface for a HOME storage system.
/// </summary>
public interface IHomeStorage
{
2023-07-09 21:10:40 +00:00
/// <summary>
/// Checks if the given tracker exists in the storage system.
/// </summary>
/// <param name="tracker">Tracker to check</param>
/// <returns>True if the tracker exists, false otherwise.</returns>
bool Exists(ulong tracker);
2023-07-09 21:10:40 +00:00
/// <summary>
/// Gets the HOME entity for the given <see cref="PKM"/>.
/// </summary>
/// <typeparam name="T">Input PKM type</typeparam>
/// <param name="pk">PKM to get the entity for</param>
/// <returns>HOME entity for the given <see cref="PKM"/>.</returns>
PKH GetEntity<T>(T pk) where T : PKM;
}
2023-07-09 21:10:40 +00:00
/// <summary>
/// Facade for a HOME storage system.
/// </summary>
public sealed class HomeStorageFacade : IHomeStorage
{
public bool Exists(ulong tracker) => false;
public PKH GetEntity<T>(T pk) where T : PKM => PKH.ConvertFromPKM(pk);
}