2023-06-04 01:19:16 +00:00
|
|
|
namespace PKHeX.Core;
|
|
|
|
|
2023-07-09 21:10:40 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Interface for a HOME storage system.
|
|
|
|
/// </summary>
|
2023-06-04 01:19:16 +00:00
|
|
|
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>
|
2023-06-04 01:19:16 +00:00
|
|
|
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>
|
2023-06-04 01:19:16 +00:00
|
|
|
PKH GetEntity<T>(T pk) where T : PKM;
|
|
|
|
}
|
|
|
|
|
2023-07-09 21:10:40 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Facade for a HOME storage system.
|
|
|
|
/// </summary>
|
2023-06-04 01:19:16 +00:00
|
|
|
public sealed class HomeStorageFacade : IHomeStorage
|
|
|
|
{
|
|
|
|
public bool Exists(ulong tracker) => false;
|
|
|
|
public PKH GetEntity<T>(T pk) where T : PKM => PKH.ConvertFromPKM(pk);
|
|
|
|
}
|