mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 12:33:06 +00:00
5bcccc6d92
* 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.
57 lines
2.2 KiB
C#
57 lines
2.2 KiB
C#
namespace PKHeX.Core
|
|
{
|
|
/// <summary> Ribbons introduced in Generation 4 for Special Events </summary>
|
|
public interface IRibbonSetEvent4
|
|
{
|
|
bool RibbonClassic { get; set; }
|
|
bool RibbonWishing { get; set; }
|
|
bool RibbonPremier { get; set; }
|
|
bool RibbonEvent { get; set; }
|
|
bool RibbonBirthday { get; set; }
|
|
bool RibbonSpecial { get; set; }
|
|
bool RibbonWorld { get; set; }
|
|
bool RibbonChampionWorld { get; set; }
|
|
bool RibbonSouvenir { get; set; }
|
|
}
|
|
|
|
internal static partial class RibbonExtensions
|
|
{
|
|
private static readonly string[] RibbonSetNamesEvent4 =
|
|
{
|
|
nameof(IRibbonSetEvent4.RibbonClassic), nameof(IRibbonSetEvent4.RibbonWishing), nameof(IRibbonSetEvent4.RibbonPremier),
|
|
nameof(IRibbonSetEvent4.RibbonEvent), nameof(IRibbonSetEvent4.RibbonBirthday), nameof(IRibbonSetEvent4.RibbonSpecial),
|
|
nameof(IRibbonSetEvent4.RibbonWorld), nameof(IRibbonSetEvent4.RibbonChampionWorld), nameof(IRibbonSetEvent4.RibbonSouvenir),
|
|
};
|
|
|
|
internal static bool[] RibbonBits(this IRibbonSetEvent4 set)
|
|
{
|
|
return new[]
|
|
{
|
|
set.RibbonClassic,
|
|
set.RibbonWishing,
|
|
set.RibbonPremier,
|
|
set.RibbonEvent,
|
|
set.RibbonBirthday,
|
|
set.RibbonSpecial,
|
|
set.RibbonWorld,
|
|
set.RibbonChampionWorld,
|
|
set.RibbonSouvenir,
|
|
};
|
|
}
|
|
|
|
internal static string[] RibbonNames(this IRibbonSetEvent4 _) => RibbonSetNamesEvent4;
|
|
|
|
internal static void CopyRibbonSetEvent4(this IRibbonSetEvent4 set, IRibbonSetEvent4 dest)
|
|
{
|
|
dest.RibbonClassic = set.RibbonClassic;
|
|
dest.RibbonWishing = set.RibbonWishing;
|
|
dest.RibbonPremier = set.RibbonPremier;
|
|
dest.RibbonEvent = set.RibbonEvent;
|
|
dest.RibbonBirthday = set.RibbonBirthday;
|
|
dest.RibbonSpecial = set.RibbonSpecial;
|
|
dest.RibbonWorld = set.RibbonWorld;
|
|
dest.RibbonChampionWorld = set.RibbonChampionWorld;
|
|
dest.RibbonSouvenir = set.RibbonSouvenir;
|
|
}
|
|
}
|
|
}
|