PKHeX/PKHeX.Core/Ribbons/IRibbonSetEvent3.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

47 lines
1.8 KiB
C#

namespace PKHeX.Core
{
/// <summary> Ribbons introduced in Generation 3 for Special Events </summary>
public interface IRibbonSetEvent3
{
bool RibbonEarth { get; set; }
bool RibbonNational { get; set; }
bool RibbonCountry { get; set; }
bool RibbonChampionBattle { get; set; }
bool RibbonChampionRegional { get; set; }
bool RibbonChampionNational { get; set; }
}
internal static partial class RibbonExtensions
{
private static readonly string[] RibbonSetNamesEvent3 =
{
nameof(IRibbonSetEvent3.RibbonEarth), nameof(IRibbonSetEvent3.RibbonNational), nameof(IRibbonSetEvent3.RibbonCountry),
nameof(IRibbonSetEvent3.RibbonChampionBattle), nameof(IRibbonSetEvent3.RibbonChampionRegional), nameof(IRibbonSetEvent3.RibbonChampionNational),
};
internal static bool[] RibbonBits(this IRibbonSetEvent3 set)
{
return new[]
{
set.RibbonEarth,
set.RibbonNational,
set.RibbonCountry,
set.RibbonChampionBattle,
set.RibbonChampionRegional,
set.RibbonChampionNational,
};
}
internal static string[] RibbonNames(this IRibbonSetEvent3 _) => RibbonSetNamesEvent3;
internal static void CopyRibbonSetEvent3(this IRibbonSetEvent3 set, IRibbonSetEvent3 dest)
{
dest.RibbonEarth = set.RibbonEarth;
dest.RibbonNational = set.RibbonNational;
dest.RibbonCountry = set.RibbonCountry;
dest.RibbonChampionBattle = set.RibbonChampionBattle;
dest.RibbonChampionRegional = set.RibbonChampionRegional;
dest.RibbonChampionNational = set.RibbonChampionNational;
}
}
}