From 383037db435d591ff7cac5de98e995ba45bf2cec Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 20 Apr 2025 11:06:08 -0500 Subject: [PATCH] More xmldoc updates --- .../Editing/Applicators/MarkingApplicator.cs | 6 ++-- .../Editing/Applicators/MemoryApplicator.cs | 4 +-- .../Editing/Applicators/RibbonApplicator.cs | 3 +- PKHeX.Core/Editing/Bulk/IPropertyProvider.cs | 10 +++++++ PKHeX.Core/Editing/HiddenPower.cs | 5 ++++ .../Editing/Saves/BoxManip/IBoxManip.cs | 29 ++++++++++++++++++- PKHeX.Core/Game/GameStrings/GameInfo.cs | 2 +- PKHeX.Core/Game/GameStrings/GameStrings.cs | 2 +- .../Encounters/Data/EncounterEvent.cs | 10 +++---- .../Templates/GO/EncounterSlot8GO.cs | 2 +- .../Templates/Gen8b/EncounterArea8b.cs | 2 +- .../Templates/Gen8b/EncounterSlot8b.cs | 2 +- .../Legality/RNG/ClassicEra/Gen3/MethodH.cs | 2 +- .../Legality/Restrictions/GBRestrictions.cs | 2 +- .../Verifiers/Ability/AbilityBreedLegality.cs | 8 ++--- PKHeX.Core/PKM/SK2.cs | 2 +- PKHeX.Core/PersonalInfo/PersonalTable.cs | 10 +++---- .../PersonalInfo/Table/PersonalTable8BDSP.cs | 2 +- .../Saves/Encryption/MemeCrypto/MemeCrypto.cs | 2 +- PKHeX.Core/Saves/SAV2.cs | 2 +- PKHeX.Core/Saves/SAV8BS.cs | 2 +- PKHeX.Core/Saves/SAV_STADIUM.cs | 2 +- PKHeX.Core/Saves/Substructures/Gen6/PSS6.cs | 2 +- 23 files changed, 79 insertions(+), 34 deletions(-) diff --git a/PKHeX.Core/Editing/Applicators/MarkingApplicator.cs b/PKHeX.Core/Editing/Applicators/MarkingApplicator.cs index b0d52792a..c025256cb 100644 --- a/PKHeX.Core/Editing/Applicators/MarkingApplicator.cs +++ b/PKHeX.Core/Editing/Applicators/MarkingApplicator.cs @@ -28,7 +28,8 @@ public static void SetMarkings(this PKM pk) SetMarkings(b, pk); } - private static void SetMarkings(this IAppliedMarkings mark, PKM pk) + /// + public static void SetMarkings(this IAppliedMarkings mark, PKM pk) { var method = MarkingMethod(pk); mark.SetMarking(0, method(pk.IV_HP , 0) == 1); @@ -39,7 +40,8 @@ private static void SetMarkings(this IAppliedMarkings mark, PKM pk) mark.SetMarking(5, method(pk.IV_SPE, 5) == 1); } - private static void SetMarkings(this IAppliedMarkings mark, PKM pk) + /// + public static void SetMarkings(this IAppliedMarkings mark, PKM pk) { var method = MarkingMethod(pk); mark.SetMarking(0, (MarkingColor)method(pk.IV_HP, 0)); diff --git a/PKHeX.Core/Editing/Applicators/MemoryApplicator.cs b/PKHeX.Core/Editing/Applicators/MemoryApplicator.cs index 982066462..c766ad1b4 100644 --- a/PKHeX.Core/Editing/Applicators/MemoryApplicator.cs +++ b/PKHeX.Core/Editing/Applicators/MemoryApplicator.cs @@ -20,7 +20,7 @@ public static void ClearMemories(this PKM pk) } /// - /// Sets the Memory details to a Hatched Egg's memories. + /// Sets the Memory details to a Hatched Egg's memories specific to origin. /// /// Pokémon to modify. public static void SetHatchMemory6(this PKM pk) @@ -37,7 +37,7 @@ public static void SetHatchMemory6(this PKM pk) } /// - /// Sets a random memory specific to locality. + /// Sets a random memory specific to origin. /// /// Pokémon to modify. public static void SetRandomMemory6(this PK6 pk) diff --git a/PKHeX.Core/Editing/Applicators/RibbonApplicator.cs b/PKHeX.Core/Editing/Applicators/RibbonApplicator.cs index 7b77602b3..7eabf70f4 100644 --- a/PKHeX.Core/Editing/Applicators/RibbonApplicator.cs +++ b/PKHeX.Core/Editing/Applicators/RibbonApplicator.cs @@ -59,7 +59,7 @@ private static void SetAllRibbonState(in RibbonVerifierArguments args, bool desi if (desiredState) { - // Skip Marks, don't set them. + // Skip personality marks (Encounter specific, never required); don't set them. for (RibbonIndex r = 0; r <= RibbonIndex.MasterRank; r++) r.Fix(args, desiredState); for (RibbonIndex r = RibbonIndex.Hisui; r < RibbonIndex.MAX_COUNT; r++) @@ -75,6 +75,7 @@ private static void SetAllRibbonState(in RibbonVerifierArguments args, bool desi private static void InvertDeadlockContest(IRibbonSetCommon6 c6, bool desiredState) { + // Contest Star is a deadlock ribbon with the Master ribbons, as it needs all five Master ribbons to be true. if (desiredState) c6.RibbonContestStar = c6.HasAllContestRibbons(); } diff --git a/PKHeX.Core/Editing/Bulk/IPropertyProvider.cs b/PKHeX.Core/Editing/Bulk/IPropertyProvider.cs index 22c9d44f2..12d27369f 100644 --- a/PKHeX.Core/Editing/Bulk/IPropertyProvider.cs +++ b/PKHeX.Core/Editing/Bulk/IPropertyProvider.cs @@ -2,8 +2,18 @@ namespace PKHeX.Core; +/// +/// Interface for retrieving properties from a . +/// public interface IPropertyProvider { + /// + /// Attempts to retrieve a property's value (as string) from a instance. + /// + /// Entity to retrieve the property from. + /// Property name to retrieve. + /// Property value as string. + /// true if the property was found and retrieved successfully; otherwise, false. bool TryGetProperty(PKM pk, string prop, [NotNullWhen(true)] out string? result); } diff --git a/PKHeX.Core/Editing/HiddenPower.cs b/PKHeX.Core/Editing/HiddenPower.cs index 5b190ccf8..b0d0d8579 100644 --- a/PKHeX.Core/Editing/HiddenPower.cs +++ b/PKHeX.Core/Editing/HiddenPower.cs @@ -71,6 +71,11 @@ public static int GetTypeBigEndian(uint u32) /// public const int TypeCount = 16; + /// + /// Checks if the input Hidden Power Type is not one of the 15 valid types. + /// + /// Hidden Power Type + /// true if the input Hidden Power Type is not one of the 15 valid types. public static bool IsInvalidType(int type) => (uint)type >= TypeCount; /// diff --git a/PKHeX.Core/Editing/Saves/BoxManip/IBoxManip.cs b/PKHeX.Core/Editing/Saves/BoxManip/IBoxManip.cs index 3bc9c1c4e..95ddf886c 100644 --- a/PKHeX.Core/Editing/Saves/BoxManip/IBoxManip.cs +++ b/PKHeX.Core/Editing/Saves/BoxManip/IBoxManip.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace PKHeX.Core; @@ -7,12 +7,39 @@ namespace PKHeX.Core; /// public interface IBoxManip { + /// + /// Type of box manipulation action. + /// BoxManipType Type { get; } + + /// + /// Function to determine if the action is usable on the current save file. + /// Func Usable { get; } + /// + /// Message to display when asking the user to confirm the action. + /// + /// All boxes or just one? string GetPrompt(bool all); + + /// + /// Message to display when the action cannot be performed/failed. + /// + /// All boxes or just one? string GetFail(bool all); + + /// + /// Message to display when the action is successfully completed. + /// + /// All boxes or just one? string GetSuccess(bool all); + /// + /// Executes the box manipulation action on the provided save file. + /// + /// Save file to manipulate. + /// Parameters for the manipulation action. + /// Count of slots modified. int Execute(SaveFile sav, BoxManipParam param); } diff --git a/PKHeX.Core/Game/GameStrings/GameInfo.cs b/PKHeX.Core/Game/GameStrings/GameInfo.cs index 6144e0262..e26b7d036 100644 --- a/PKHeX.Core/Game/GameStrings/GameInfo.cs +++ b/PKHeX.Core/Game/GameStrings/GameInfo.cs @@ -65,7 +65,7 @@ public static IReadOnlyList LanguageDataSource(byte generation) /// Location value /// Current /// of origin - /// Current GameVersion (only applicable for differentiation) + /// Version within , if needed to differentiate. /// Location name public static string GetLocationName(bool isEggLocation, ushort location, byte format, byte generation, GameVersion version) { diff --git a/PKHeX.Core/Game/GameStrings/GameStrings.cs b/PKHeX.Core/Game/GameStrings/GameStrings.cs index 94778fe9e..0fc8e19d5 100644 --- a/PKHeX.Core/Game/GameStrings/GameStrings.cs +++ b/PKHeX.Core/Game/GameStrings/GameStrings.cs @@ -795,7 +795,7 @@ private string[] GetItemStrings3(GameVersion game) /// Location value /// Current /// of origin - /// Current GameVersion (only applicable for differentiation) + /// Version within , if needed to differentiate. /// Location name. Potentially an empty string if no location name is known for that location value. public string GetLocationName(bool isEggLocation, ushort location, byte format, byte generation, GameVersion version) { diff --git a/PKHeX.Core/Legality/Encounters/Data/EncounterEvent.cs b/PKHeX.Core/Legality/Encounters/Data/EncounterEvent.cs index 1b060bbbd..4d3826c3d 100644 --- a/PKHeX.Core/Legality/Encounters/Data/EncounterEvent.cs +++ b/PKHeX.Core/Legality/Encounters/Data/EncounterEvent.cs @@ -25,19 +25,19 @@ public static class EncounterEvent /// Event Database for Generation 7 public static readonly WC7[] MGDB_G7 = GetWC7DB(Util.GetBinaryResource("wc7.pkl"), Util.GetBinaryResource("wc7full.pkl")); - /// Event Database for Generation 7 + /// Event Database for Generation 7 public static readonly WB7[] MGDB_G7GG = GetWB7DB(Util.GetBinaryResource("wb7full.pkl")); - /// Event Database for Generation 8 + /// Event Database for Generation 8 public static readonly WC8[] MGDB_G8 = GetWC8DB(Util.GetBinaryResource("wc8.pkl")); - /// Event Database for Generation 8 + /// Event Database for Generation 8 public static readonly WA8[] MGDB_G8A = GetWA8DB(Util.GetBinaryResource("wa8.pkl")); - /// Event Database for Generation 8 + /// Event Database for Generation 8 public static readonly WB8[] MGDB_G8B = GetWB8DB(Util.GetBinaryResource("wb8.pkl")); - /// Event Database for Generation 9 + /// Event Database for Generation 9 public static readonly WC9[] MGDB_G9 = GetWC9DB(Util.GetBinaryResource("wc9.pkl")); #endregion diff --git a/PKHeX.Core/Legality/Encounters/Templates/GO/EncounterSlot8GO.cs b/PKHeX.Core/Legality/Encounters/Templates/GO/EncounterSlot8GO.cs index b4a23bdd9..1f80e2139 100644 --- a/PKHeX.Core/Legality/Encounters/Templates/GO/EncounterSlot8GO.cs +++ b/PKHeX.Core/Legality/Encounters/Templates/GO/EncounterSlot8GO.cs @@ -4,7 +4,7 @@ namespace PKHeX.Core; /// -/// Encounter Slot representing data transferred to (HOME). +/// Encounter Slot representing data transferred to HOME. /// /// public sealed record EncounterSlot8GO(int StartDate, int EndDate, ushort Species, byte Form, byte LevelMin, byte LevelMax, Shiny Shiny, Gender Gender, PogoType Type, PogoImportFormat OriginFormat) diff --git a/PKHeX.Core/Legality/Encounters/Templates/Gen8b/EncounterArea8b.cs b/PKHeX.Core/Legality/Encounters/Templates/Gen8b/EncounterArea8b.cs index 41cb4db57..55df7e97e 100644 --- a/PKHeX.Core/Legality/Encounters/Templates/Gen8b/EncounterArea8b.cs +++ b/PKHeX.Core/Legality/Encounters/Templates/Gen8b/EncounterArea8b.cs @@ -6,7 +6,7 @@ namespace PKHeX.Core; /// -/// encounter area +/// encounter area /// public sealed record EncounterArea8b : IEncounterArea, IAreaLocation { diff --git a/PKHeX.Core/Legality/Encounters/Templates/Gen8b/EncounterSlot8b.cs b/PKHeX.Core/Legality/Encounters/Templates/Gen8b/EncounterSlot8b.cs index 72ecab0b4..b90f98d9d 100644 --- a/PKHeX.Core/Legality/Encounters/Templates/Gen8b/EncounterSlot8b.cs +++ b/PKHeX.Core/Legality/Encounters/Templates/Gen8b/EncounterSlot8b.cs @@ -4,7 +4,7 @@ namespace PKHeX.Core; /// -/// Encounter Slot found in . +/// Encounter Slot found in . /// public sealed record EncounterSlot8b(EncounterArea8b Parent, ushort Species, byte Form, byte LevelMin, byte LevelMax) : IEncounterable, IEncounterMatch, IEncounterConvertible diff --git a/PKHeX.Core/Legality/RNG/ClassicEra/Gen3/MethodH.cs b/PKHeX.Core/Legality/RNG/ClassicEra/Gen3/MethodH.cs index 39f2e49bb..4c97f5a82 100644 --- a/PKHeX.Core/Legality/RNG/ClassicEra/Gen3/MethodH.cs +++ b/PKHeX.Core/Legality/RNG/ClassicEra/Gen3/MethodH.cs @@ -7,7 +7,7 @@ namespace PKHeX.Core; /// -/// Method H logic used by mainline RNG. +/// Method H logic used by mainline RNG. /// public static class MethodH { diff --git a/PKHeX.Core/Legality/Restrictions/GBRestrictions.cs b/PKHeX.Core/Legality/Restrictions/GBRestrictions.cs index 0eba71041..9d1f8e0b9 100644 --- a/PKHeX.Core/Legality/Restrictions/GBRestrictions.cs +++ b/PKHeX.Core/Legality/Restrictions/GBRestrictions.cs @@ -120,7 +120,7 @@ private static bool GetCatchRateMatchesPreEvolution(PK1 pk, byte rate) } /// - /// Checks if the can inhabit + /// Checks if the can inhabit /// /// Data to check /// true if it can inhabit, false if it can not. diff --git a/PKHeX.Core/Legality/Verifiers/Ability/AbilityBreedLegality.cs b/PKHeX.Core/Legality/Verifiers/Ability/AbilityBreedLegality.cs index dbb159828..254e4d5dc 100644 --- a/PKHeX.Core/Legality/Verifiers/Ability/AbilityBreedLegality.cs +++ b/PKHeX.Core/Legality/Verifiers/Ability/AbilityBreedLegality.cs @@ -21,7 +21,7 @@ internal static class AbilityBreedLegality ]; /// - /// Species that cannot be bred with a Hidden Ability originating in + /// Species that cannot be bred with a Hidden Ability originating in /// public static bool IsHiddenPossible5(ushort species) { @@ -33,7 +33,7 @@ public static bool IsHiddenPossible5(ushort species) } /// - /// Species that cannot be bred with a Hidden Ability originating in + /// Species that cannot be bred with a Hidden Ability originating in /// public static bool IsHiddenPossible6(ushort species, byte form) => species switch { @@ -54,7 +54,7 @@ public static bool IsHiddenPossible5(ushort species) }; /// - /// Species that cannot be bred with a Hidden Ability originating in + /// Species that cannot be bred with a Hidden Ability originating in /// public static bool IsHiddenPossible7(ushort species, byte form) => species switch { @@ -74,7 +74,7 @@ public static bool IsHiddenPossible5(ushort species) }; /// - /// Species that cannot be bred with a Hidden Ability originating in + /// Species that cannot be bred with a Hidden Ability originating in games that link together via HOME. /// public static bool IsHiddenPossibleHOME(ushort eggSpecies) => eggSpecies is not (int)Phione; // Everything else can! } diff --git a/PKHeX.Core/PKM/SK2.cs b/PKHeX.Core/PKM/SK2.cs index e6e26ff2d..b7a9c6218 100644 --- a/PKHeX.Core/PKM/SK2.cs +++ b/PKHeX.Core/PKM/SK2.cs @@ -3,7 +3,7 @@ namespace PKHeX.Core; -/// Generation 2 format for . +/// Generation 2 format for . public sealed class SK2 : GBPKM, ICaughtData2 { public override PersonalInfo2 PersonalInfo => PersonalTable.C[Species]; diff --git a/PKHeX.Core/PersonalInfo/PersonalTable.cs b/PKHeX.Core/PersonalInfo/PersonalTable.cs index 1323daab7..c188bbab2 100644 --- a/PKHeX.Core/PersonalInfo/PersonalTable.cs +++ b/PKHeX.Core/PersonalInfo/PersonalTable.cs @@ -11,27 +11,27 @@ namespace PKHeX.Core; public static class PersonalTable { /// - /// Personal Table used in . + /// Personal Table used in . /// public static readonly PersonalTable9SV SV = new(GetTable("sv")); /// - /// Personal Table used in . + /// Personal Table used in . /// public static readonly PersonalTable8LA LA = new(GetTable("la")); /// - /// Personal Table used in . + /// Personal Table used in . /// public static readonly PersonalTable8BDSP BDSP = new(GetTable("bdsp")); /// - /// Personal Table used in . + /// Personal Table used in . /// public static readonly PersonalTable8SWSH SWSH = new(GetTable("swsh")); /// - /// Personal Table used in . + /// Personal Table used in . /// public static readonly PersonalTable7GG GG = new(GetTable("gg")); diff --git a/PKHeX.Core/PersonalInfo/Table/PersonalTable8BDSP.cs b/PKHeX.Core/PersonalInfo/Table/PersonalTable8BDSP.cs index e3b4e8322..acf7c1533 100644 --- a/PKHeX.Core/PersonalInfo/Table/PersonalTable8BDSP.cs +++ b/PKHeX.Core/PersonalInfo/Table/PersonalTable8BDSP.cs @@ -3,7 +3,7 @@ namespace PKHeX.Core; /// -/// Personal Table storing used in . +/// Personal Table storing used in . /// public sealed class PersonalTable8BDSP : IPersonalTable, IPersonalTable { diff --git a/PKHeX.Core/Saves/Encryption/MemeCrypto/MemeCrypto.cs b/PKHeX.Core/Saves/Encryption/MemeCrypto/MemeCrypto.cs index 1d32c0241..d1d6d05ff 100644 --- a/PKHeX.Core/Saves/Encryption/MemeCrypto/MemeCrypto.cs +++ b/PKHeX.Core/Saves/Encryption/MemeCrypto/MemeCrypto.cs @@ -8,7 +8,7 @@ namespace PKHeX.Core; /// MemeCrypto V1 - The Original Series /// /// -/// A variant of encryption and obfuscation used in . +/// A variant of encryption and obfuscation used in . ///
The save file stores a dedicated block to contain a hash of the savedata, computed when the block is zeroed.
///
This signing logic is reused for other authentication; refer to .
///
The save file first computes a SHA256 Hash over the block checksum region. diff --git a/PKHeX.Core/Saves/SAV2.cs b/PKHeX.Core/Saves/SAV2.cs index 5eebb7a47..77cee1083 100644 --- a/PKHeX.Core/Saves/SAV2.cs +++ b/PKHeX.Core/Saves/SAV2.cs @@ -248,7 +248,7 @@ protected override byte[] GetFinalData() public override int MaxAbilityID => Legal.MaxAbilityID_2; public override int MaxItemID => Legal.MaxItemID_2; public override int MaxBallID => 0; // unused - public override GameVersion MaxGameID => GameVersion.Gen2; // unused + public override GameVersion MaxGameID => GameVersion.C; // unused public override int MaxMoney => 999999; public override int MaxCoins => 9999; diff --git a/PKHeX.Core/Saves/SAV8BS.cs b/PKHeX.Core/Saves/SAV8BS.cs index 9c80d39dc..c3e2e4fe9 100644 --- a/PKHeX.Core/Saves/SAV8BS.cs +++ b/PKHeX.Core/Saves/SAV8BS.cs @@ -6,7 +6,7 @@ namespace PKHeX.Core; /// -/// Generation 8 object for games. +/// Generation 8 object for games. /// public sealed class SAV8BS : SaveFile, ISaveFileRevision, ITrainerStatRecord, IEventWorkArray, IBoxDetailName, IBoxDetailWallpaper, IDaycareStorage, IDaycareEggState, IDaycareRandomState { diff --git a/PKHeX.Core/Saves/SAV_STADIUM.cs b/PKHeX.Core/Saves/SAV_STADIUM.cs index b36e1ddab..388584d03 100644 --- a/PKHeX.Core/Saves/SAV_STADIUM.cs +++ b/PKHeX.Core/Saves/SAV_STADIUM.cs @@ -19,7 +19,7 @@ public abstract class SAV_STADIUM : SaveFile, ILangDeviantSave public bool Korean => false; public sealed override int MaxBallID => 0; // unused - public sealed override GameVersion MaxGameID => GameVersion.Gen1; // unused + public sealed override GameVersion MaxGameID => GameVersion.YW; // unused public sealed override int MaxMoney => 999999; public sealed override int MaxCoins => 9999; diff --git a/PKHeX.Core/Saves/Substructures/Gen6/PSS6.cs b/PKHeX.Core/Saves/Substructures/Gen6/PSS6.cs index d983e884e..8fe009b38 100644 --- a/PKHeX.Core/Saves/Substructures/Gen6/PSS6.cs +++ b/PKHeX.Core/Saves/Substructures/Gen6/PSS6.cs @@ -80,7 +80,7 @@ private static bool ReadTrainer(List result, ReadOnlySpan data) private static string GetGameName(GameVersion game) { const string unk = "UNKNOWN GAME"; - if (!GameVersion.Gen6.Contains(game)) + if (game is not (GameVersion.X or GameVersion.Y or GameVersion.OR or GameVersion.AS)) return unk; var list = GameInfo.Strings.gamelist; return list[(byte)game];