mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-25 03:43:16 +00:00
26b1453002
Fix RibbonVerifier4 not checking gen4 contest ribbons correctly Split IRibbonCommon6 to have memory ribbons separate, as they are not implemented in mystery gifts. Also, we can add the boolean flags to the interface, and check that the boolean is set if count is nonzero. Fix adding ribbons to Gen8 gift templates Improve Gen8 template ribbon fetch (no closure, faster IndexOf)
43 lines
1.8 KiB
C#
43 lines
1.8 KiB
C#
namespace PKHeX.Core;
|
|
|
|
/// <summary> Common Ribbons introduced in Generation 6 </summary>
|
|
public interface IRibbonSetCommon6
|
|
{
|
|
bool RibbonChampionKalos { get; set; }
|
|
bool RibbonChampionG6Hoenn { get; set; }
|
|
bool RibbonBestFriends { get; set; }
|
|
bool RibbonTraining { get; set; }
|
|
bool RibbonBattlerSkillful { get; set; }
|
|
bool RibbonBattlerExpert { get; set; }
|
|
|
|
bool RibbonContestStar { get; set; }
|
|
bool RibbonMasterCoolness { get; set; }
|
|
bool RibbonMasterBeauty { get; set; }
|
|
bool RibbonMasterCuteness { get; set; }
|
|
bool RibbonMasterCleverness { get; set; }
|
|
bool RibbonMasterToughness { get; set; }
|
|
}
|
|
|
|
internal static partial class RibbonExtensions
|
|
{
|
|
/// <summary>
|
|
/// Checks if the <see cref="set"/> has all five contest stat ribbons true.
|
|
/// </summary>
|
|
public static bool HasAllContestRibbons(this IRibbonSetCommon6 set) => set.RibbonMasterCoolness && set.RibbonMasterBeauty && set.RibbonMasterCuteness && set.RibbonMasterCleverness && set.RibbonMasterToughness;
|
|
|
|
internal static void CopyRibbonSetCommon6(this IRibbonSetCommon6 set, IRibbonSetCommon6 dest)
|
|
{
|
|
dest.RibbonChampionKalos = set.RibbonChampionKalos;
|
|
dest.RibbonChampionG6Hoenn = set.RibbonChampionG6Hoenn;
|
|
dest.RibbonBestFriends = set.RibbonBestFriends;
|
|
dest.RibbonTraining = set.RibbonTraining;
|
|
dest.RibbonBattlerSkillful = set.RibbonBattlerSkillful;
|
|
dest.RibbonBattlerExpert = set.RibbonBattlerExpert;
|
|
dest.RibbonContestStar = set.RibbonContestStar;
|
|
dest.RibbonMasterCoolness = set.RibbonMasterCoolness;
|
|
dest.RibbonMasterBeauty = set.RibbonMasterBeauty;
|
|
dest.RibbonMasterCuteness = set.RibbonMasterCuteness;
|
|
dest.RibbonMasterCleverness = set.RibbonMasterCleverness;
|
|
dest.RibbonMasterToughness = set.RibbonMasterToughness;
|
|
}
|
|
}
|