PKHeX/PKHeX.Core/Ribbons/IRibbonSetCommon7.cs
Kurt fc754b346b
File scoped namespaces (#3529)
[Language Reference](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/file-scoped-namespaces)

Updates all the files, one less level of indentation.

Some small changes were made to API surfaces, renaming `PKM pkm` -> `PKM pk`, and `LegalityAnalysis.pkm` -> `LegalityAnalysis.Entity`
2022-06-18 11:04:24 -07:00

40 lines
1.3 KiB
C#

namespace PKHeX.Core;
/// <summary> Common Ribbons introduced in Generation 7 </summary>
public interface IRibbonSetCommon7
{
bool RibbonChampionAlola { get; set; }
bool RibbonBattleRoyale { get; set; }
bool RibbonBattleTreeGreat { get; set; }
bool RibbonBattleTreeMaster { get; set; }
}
internal static partial class RibbonExtensions
{
private static readonly string[] RibbonSetNamesCommon7 =
{
nameof(IRibbonSetCommon7.RibbonChampionAlola), nameof(IRibbonSetCommon7.RibbonBattleRoyale),
nameof(IRibbonSetCommon7.RibbonBattleTreeGreat), nameof(IRibbonSetCommon7.RibbonBattleTreeMaster),
};
internal static bool[] RibbonBits(this IRibbonSetCommon7 set)
{
return new[]
{
set.RibbonChampionAlola,
set.RibbonBattleRoyale,
set.RibbonBattleTreeGreat,
set.RibbonBattleTreeMaster,
};
}
internal static string[] RibbonNames(this IRibbonSetCommon7 _) => RibbonSetNamesCommon7;
internal static void CopyRibbonSetCommon7(this IRibbonSetCommon7 set, IRibbonSetCommon7 dest)
{
dest.RibbonChampionAlola = set.RibbonChampionAlola;
dest.RibbonBattleRoyale = set.RibbonBattleRoyale;
dest.RibbonBattleTreeGreat = set.RibbonBattleTreeGreat;
dest.RibbonBattleTreeMaster = set.RibbonBattleTreeMaster;
}
}