PKHeX/PKHeX.Core/Ribbons/IRibbonSetCommon8.cs
Kurt 5bcccc6d92
HOME 2.0.0: Handle conversion behavior & restrictions (#3506)
* Revises legality checks to account for traveling between the three game islands (PLA/BDSP/SWSH)
* Adds conversion mechanisms between the three formats, as well as flexible conversion options to backfill missing data (thanks GameFreak/ILCA for opting for lossy conversion instead of updating the games).
* Adds API abstractions for HOME data storage format (EKH/PKH format 1, aka EH1/PH1).
* Revises some APIs for better usage:
  - `PKM` now exposes a `Context` to indicate the isolation context for legality purposes.
  - Some method signatures have changed to accept `Context` or `GameVersion` instead of a vague `int` for Generation.
  - Evolution History is now tracked in the Legality parse for specific contexts, rather than only per generation.
2022-05-30 21:43:52 -07:00

45 lines
No EOL
1.6 KiB
C#

namespace PKHeX.Core
{
/// <summary> Common Ribbons introduced in Generation 8 </summary>
public interface IRibbonSetCommon8
{
bool RibbonChampionGalar { get; set; }
bool RibbonTowerMaster { get; set; }
bool RibbonMasterRank { get; set; }
bool RibbonTwinklingStar { get; set; }
bool RibbonPioneer { get; set; }
}
internal static partial class RibbonExtensions
{
private static readonly string[] RibbonSetNamesCommon8 =
{
nameof(IRibbonSetCommon8.RibbonChampionGalar), nameof(IRibbonSetCommon8.RibbonTowerMaster),
nameof(IRibbonSetCommon8.RibbonMasterRank),
nameof(IRibbonSetCommon8.RibbonTwinklingStar), nameof(IRibbonSetCommon8.RibbonPioneer),
};
internal static bool[] RibbonBits(this IRibbonSetCommon8 set)
{
return new[]
{
set.RibbonChampionGalar,
set.RibbonTowerMaster,
set.RibbonMasterRank,
set.RibbonTwinklingStar,
set.RibbonPioneer,
};
}
internal static string[] RibbonNames(this IRibbonSetCommon8 _) => RibbonSetNamesCommon8;
internal static void CopyRibbonSetCommon8(this IRibbonSetCommon8 set, IRibbonSetCommon8 dest)
{
dest.RibbonChampionGalar = set.RibbonChampionGalar;
dest.RibbonTowerMaster = set.RibbonTowerMaster;
dest.RibbonMasterRank = set.RibbonMasterRank;
dest.RibbonTwinklingStar = set.RibbonTwinklingStar;
dest.RibbonPioneer = set.RibbonPioneer;
}
}
}