mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-09-10 13:17:42 -05:00
More xmldoc updates
This commit is contained in:
@@ -28,7 +28,8 @@ public static void SetMarkings(this PKM pk)
|
||||
SetMarkings(b, pk);
|
||||
}
|
||||
|
||||
private static void SetMarkings(this IAppliedMarkings<bool> mark, PKM pk)
|
||||
/// <inheritdoc cref="SetMarkings(PKM)"/>
|
||||
public static void SetMarkings(this IAppliedMarkings<bool> 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<bool> mark, PKM pk)
|
||||
mark.SetMarking(5, method(pk.IV_SPE, 5) == 1);
|
||||
}
|
||||
|
||||
private static void SetMarkings(this IAppliedMarkings<MarkingColor> mark, PKM pk)
|
||||
/// <inheritdoc cref="SetMarkings(PKM)"/>
|
||||
public static void SetMarkings(this IAppliedMarkings<MarkingColor> mark, PKM pk)
|
||||
{
|
||||
var method = MarkingMethod(pk);
|
||||
mark.SetMarking(0, (MarkingColor)method(pk.IV_HP, 0));
|
||||
|
||||
@@ -20,7 +20,7 @@ public static void ClearMemories(this PKM pk)
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the Memory details to a Hatched Egg's memories.
|
||||
/// Sets the Memory details to a Hatched Egg's memories specific to <see cref="EntityContext.Gen6"/> origin.
|
||||
/// </summary>
|
||||
/// <param name="pk">Pokémon to modify.</param>
|
||||
public static void SetHatchMemory6(this PKM pk)
|
||||
@@ -37,7 +37,7 @@ public static void SetHatchMemory6(this PKM pk)
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets a random memory specific to <see cref="GameVersion.Gen6"/> locality.
|
||||
/// Sets a random memory specific to <see cref="EntityContext.Gen6"/> origin.
|
||||
/// </summary>
|
||||
/// <param name="pk">Pokémon to modify.</param>
|
||||
public static void SetRandomMemory6(this PK6 pk)
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -2,8 +2,18 @@
|
||||
|
||||
namespace PKHeX.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Interface for retrieving properties from a <see cref="PKM"/>.
|
||||
/// </summary>
|
||||
public interface IPropertyProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// Attempts to retrieve a property's value (as string) from a <see cref="PKM"/> instance.
|
||||
/// </summary>
|
||||
/// <param name="pk">Entity to retrieve the property from.</param>
|
||||
/// <param name="prop">Property name to retrieve.</param>
|
||||
/// <param name="result">Property value as string.</param>
|
||||
/// <returns><c>true</c> if the property was found and retrieved successfully; otherwise, <c>false</c>.</returns>
|
||||
bool TryGetProperty(PKM pk, string prop, [NotNullWhen(true)] out string? result);
|
||||
}
|
||||
|
||||
|
||||
@@ -71,6 +71,11 @@ public static int GetTypeBigEndian(uint u32)
|
||||
/// </summary>
|
||||
public const int TypeCount = 16;
|
||||
|
||||
/// <summary>
|
||||
/// Checks if the input Hidden Power Type is not one of the 15 valid types.
|
||||
/// </summary>
|
||||
/// <param name="type">Hidden Power Type</param>
|
||||
/// <returns><c>true</c> if the input Hidden Power Type is not one of the 15 valid types.</returns>
|
||||
public static bool IsInvalidType(int type) => (uint)type >= TypeCount;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
|
||||
namespace PKHeX.Core;
|
||||
|
||||
@@ -7,12 +7,39 @@ namespace PKHeX.Core;
|
||||
/// </summary>
|
||||
public interface IBoxManip
|
||||
{
|
||||
/// <summary>
|
||||
/// Type of box manipulation action.
|
||||
/// </summary>
|
||||
BoxManipType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Function to determine if the action is usable on the current save file.
|
||||
/// </summary>
|
||||
Func<SaveFile, bool> Usable { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Message to display when asking the user to confirm the action.
|
||||
/// </summary>
|
||||
/// <param name="all">All boxes or just one?</param>
|
||||
string GetPrompt(bool all);
|
||||
|
||||
/// <summary>
|
||||
/// Message to display when the action cannot be performed/failed.
|
||||
/// </summary>
|
||||
/// <param name="all">All boxes or just one?</param>
|
||||
string GetFail(bool all);
|
||||
|
||||
/// <summary>
|
||||
/// Message to display when the action is successfully completed.
|
||||
/// </summary>
|
||||
/// <param name="all">All boxes or just one?</param>
|
||||
string GetSuccess(bool all);
|
||||
|
||||
/// <summary>
|
||||
/// Executes the box manipulation action on the provided save file.
|
||||
/// </summary>
|
||||
/// <param name="sav">Save file to manipulate.</param>
|
||||
/// <param name="param">Parameters for the manipulation action.</param>
|
||||
/// <returns>Count of slots modified.</returns>
|
||||
int Execute(SaveFile sav, BoxManipParam param);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public static IReadOnlyList<ComboItem> LanguageDataSource(byte generation)
|
||||
/// <param name="location">Location value</param>
|
||||
/// <param name="format">Current <see cref="PKM.Format"/></param>
|
||||
/// <param name="generation"><see cref="PKM.Generation"/> of origin</param>
|
||||
/// <param name="version">Current GameVersion (only applicable for <see cref="GameVersion.Gen7b"/> differentiation)</param>
|
||||
/// <param name="version">Version within <see cref="generation"/>, if needed to differentiate.</param>
|
||||
/// <returns>Location name</returns>
|
||||
public static string GetLocationName(bool isEggLocation, ushort location, byte format, byte generation, GameVersion version)
|
||||
{
|
||||
|
||||
@@ -795,7 +795,7 @@ private string[] GetItemStrings3(GameVersion game)
|
||||
/// <param name="location">Location value</param>
|
||||
/// <param name="format">Current <see cref="PKM.Format"/></param>
|
||||
/// <param name="generation"><see cref="PKM.Generation"/> of origin</param>
|
||||
/// <param name="version">Current GameVersion (only applicable for <see cref="GameVersion.Gen7b"/> differentiation)</param>
|
||||
/// <param name="version">Version within <see cref="generation"/>, if needed to differentiate.</param>
|
||||
/// <returns>Location name. Potentially an empty string if no location name is known for that location value.</returns>
|
||||
public string GetLocationName(bool isEggLocation, ushort location, byte format, byte generation, GameVersion version)
|
||||
{
|
||||
|
||||
@@ -25,19 +25,19 @@ public static class EncounterEvent
|
||||
/// <summary>Event Database for Generation 7</summary>
|
||||
public static readonly WC7[] MGDB_G7 = GetWC7DB(Util.GetBinaryResource("wc7.pkl"), Util.GetBinaryResource("wc7full.pkl"));
|
||||
|
||||
/// <summary>Event Database for Generation 7 <see cref="GameVersion.GG"/></summary>
|
||||
/// <summary>Event Database for Generation 7 <see cref="EntityContext.Gen7b"/></summary>
|
||||
public static readonly WB7[] MGDB_G7GG = GetWB7DB(Util.GetBinaryResource("wb7full.pkl"));
|
||||
|
||||
/// <summary>Event Database for Generation 8</summary>
|
||||
/// <summary>Event Database for Generation 8 <see cref="EntityContext.Gen8"/></summary>
|
||||
public static readonly WC8[] MGDB_G8 = GetWC8DB(Util.GetBinaryResource("wc8.pkl"));
|
||||
|
||||
/// <summary>Event Database for Generation 8 <see cref="GameVersion.PLA"/></summary>
|
||||
/// <summary>Event Database for Generation 8 <see cref="EntityContext.Gen8a"/></summary>
|
||||
public static readonly WA8[] MGDB_G8A = GetWA8DB(Util.GetBinaryResource("wa8.pkl"));
|
||||
|
||||
/// <summary>Event Database for Generation 8 <see cref="GameVersion.BDSP"/></summary>
|
||||
/// <summary>Event Database for Generation 8 <see cref="EntityContext.Gen8b"/></summary>
|
||||
public static readonly WB8[] MGDB_G8B = GetWB8DB(Util.GetBinaryResource("wb8.pkl"));
|
||||
|
||||
/// <summary>Event Database for Generation 9 <see cref="GameVersion.SV"/></summary>
|
||||
/// <summary>Event Database for Generation 9 <see cref="EntityContext.Gen9"/></summary>
|
||||
public static readonly WC9[] MGDB_G9 = GetWC9DB(Util.GetBinaryResource("wc9.pkl"));
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
namespace PKHeX.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Encounter Slot representing data transferred to <see cref="GameVersion.Gen8"/> (HOME).
|
||||
/// Encounter Slot representing data transferred to HOME.
|
||||
/// <inheritdoc cref="PogoSlotExtensions" />
|
||||
/// </summary>
|
||||
public sealed record EncounterSlot8GO(int StartDate, int EndDate, ushort Species, byte Form, byte LevelMin, byte LevelMax, Shiny Shiny, Gender Gender, PogoType Type, PogoImportFormat OriginFormat)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
namespace PKHeX.Core;
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="GameVersion.BDSP"/> encounter area
|
||||
/// <see cref="EntityContext.Gen8b"/> encounter area
|
||||
/// </summary>
|
||||
public sealed record EncounterArea8b : IEncounterArea<EncounterSlot8b>, IAreaLocation
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
namespace PKHeX.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Encounter Slot found in <see cref="GameVersion.BDSP"/>.
|
||||
/// Encounter Slot found in <see cref="EntityContext.Gen8b"/>.
|
||||
/// </summary>
|
||||
public sealed record EncounterSlot8b(EncounterArea8b Parent, ushort Species, byte Form, byte LevelMin, byte LevelMax)
|
||||
: IEncounterable, IEncounterMatch, IEncounterConvertible<PB8>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
namespace PKHeX.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Method H logic used by mainline <see cref="GameVersion.Gen3"/> RNG.
|
||||
/// Method H logic used by mainline <see cref="EntityContext.Gen3"/> RNG.
|
||||
/// </summary>
|
||||
public static class MethodH
|
||||
{
|
||||
|
||||
@@ -120,7 +120,7 @@ private static bool GetCatchRateMatchesPreEvolution(PK1 pk, byte rate)
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if the <see cref="pk"/> can inhabit <see cref="Gen1"></see>
|
||||
/// Checks if the <see cref="pk"/> can inhabit <see cref="EntityContext.Gen1"></see>
|
||||
/// </summary>
|
||||
/// <param name="pk">Data to check</param>
|
||||
/// <returns>true if it can inhabit, false if it can not.</returns>
|
||||
|
||||
@@ -21,7 +21,7 @@ internal static class AbilityBreedLegality
|
||||
];
|
||||
|
||||
/// <summary>
|
||||
/// Species that cannot be bred with a Hidden Ability originating in <see cref="GameVersion.Gen5"/>
|
||||
/// Species that cannot be bred with a Hidden Ability originating in <see cref="EntityContext.Gen5"/>
|
||||
/// </summary>
|
||||
public static bool IsHiddenPossible5(ushort species)
|
||||
{
|
||||
@@ -33,7 +33,7 @@ public static bool IsHiddenPossible5(ushort species)
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Species that cannot be bred with a Hidden Ability originating in <see cref="GameVersion.Gen6"/>
|
||||
/// Species that cannot be bred with a Hidden Ability originating in <see cref="EntityContext.Gen6"/>
|
||||
/// </summary>
|
||||
public static bool IsHiddenPossible6(ushort species, byte form) => species switch
|
||||
{
|
||||
@@ -54,7 +54,7 @@ public static bool IsHiddenPossible5(ushort species)
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Species that cannot be bred with a Hidden Ability originating in <see cref="GameVersion.Gen7"/>
|
||||
/// Species that cannot be bred with a Hidden Ability originating in <see cref="EntityContext.Gen7"/>
|
||||
/// </summary>
|
||||
public static bool IsHiddenPossible7(ushort species, byte form) => species switch
|
||||
{
|
||||
@@ -74,7 +74,7 @@ public static bool IsHiddenPossible5(ushort species)
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Species that cannot be bred with a Hidden Ability originating in <see cref="GameVersion.BDSP"/>
|
||||
/// Species that cannot be bred with a Hidden Ability originating in games that link together via HOME.
|
||||
/// </summary>
|
||||
public static bool IsHiddenPossibleHOME(ushort eggSpecies) => eggSpecies is not (int)Phione; // Everything else can!
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
namespace PKHeX.Core;
|
||||
|
||||
/// <summary> Generation 2 <see cref="PKM"/> format for <see cref="GameVersion.Stadium2"/>. </summary>
|
||||
/// <summary> Generation 2 <see cref="PKM"/> format for <see cref="SAV2Stadium"/>. </summary>
|
||||
public sealed class SK2 : GBPKM, ICaughtData2
|
||||
{
|
||||
public override PersonalInfo2 PersonalInfo => PersonalTable.C[Species];
|
||||
|
||||
@@ -11,27 +11,27 @@ namespace PKHeX.Core;
|
||||
public static class PersonalTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Personal Table used in <see cref="GameVersion.SV"/>.
|
||||
/// Personal Table used in <see cref="EntityContext.Gen9"/>.
|
||||
/// </summary>
|
||||
public static readonly PersonalTable9SV SV = new(GetTable("sv"));
|
||||
|
||||
/// <summary>
|
||||
/// Personal Table used in <see cref="GameVersion.PLA"/>.
|
||||
/// Personal Table used in <see cref="EntityContext.Gen8a"/>.
|
||||
/// </summary>
|
||||
public static readonly PersonalTable8LA LA = new(GetTable("la"));
|
||||
|
||||
/// <summary>
|
||||
/// Personal Table used in <see cref="GameVersion.BDSP"/>.
|
||||
/// Personal Table used in <see cref="EntityContext.Gen8b"/>.
|
||||
/// </summary>
|
||||
public static readonly PersonalTable8BDSP BDSP = new(GetTable("bdsp"));
|
||||
|
||||
/// <summary>
|
||||
/// Personal Table used in <see cref="GameVersion.SWSH"/>.
|
||||
/// Personal Table used in <see cref="EntityContext.Gen8"/>.
|
||||
/// </summary>
|
||||
public static readonly PersonalTable8SWSH SWSH = new(GetTable("swsh"));
|
||||
|
||||
/// <summary>
|
||||
/// Personal Table used in <see cref="GameVersion.GG"/>.
|
||||
/// Personal Table used in <see cref="EntityContext.Gen7b"/>.
|
||||
/// </summary>
|
||||
public static readonly PersonalTable7GG GG = new(GetTable("gg"));
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace PKHeX.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Personal Table storing <see cref="PersonalInfo8BDSP"/> used in <see cref="GameVersion.BDSP"/>.
|
||||
/// Personal Table storing <see cref="PersonalInfo8BDSP"/> used in <see cref="EntityContext.Gen8b"/>.
|
||||
/// </summary>
|
||||
public sealed class PersonalTable8BDSP : IPersonalTable, IPersonalTable<PersonalInfo8BDSP>
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace PKHeX.Core;
|
||||
/// MemeCrypto V1 - The Original Series
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A variant of <see cref="SaveFile"/> encryption and obfuscation used in <see cref="GameVersion.Gen7"/>.
|
||||
/// A variant of <see cref="SaveFile"/> encryption and obfuscation used in <see cref="EntityContext.Gen7"/>.
|
||||
/// <br> The save file stores a dedicated block to contain a hash of the savedata, computed when the block is zeroed. </br>
|
||||
/// <br> This signing logic is reused for other authentication; refer to <see cref="MemeKeyIndex"/>. </br>
|
||||
/// <br> The save file first computes a SHA256 Hash over the block checksum region.
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
namespace PKHeX.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Generation 8 <see cref="SaveFile"/> object for <see cref="GameVersion.BDSP"/> games.
|
||||
/// Generation 8 <see cref="SaveFile"/> object for <see cref="EntityContext.Gen8b"/> games.
|
||||
/// </summary>
|
||||
public sealed class SAV8BS : SaveFile, ISaveFileRevision, ITrainerStatRecord, IEventWorkArray<int>, IBoxDetailName, IBoxDetailWallpaper, IDaycareStorage, IDaycareEggState, IDaycareRandomState<ulong>
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ private static bool ReadTrainer(List<string> result, ReadOnlySpan<byte> 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];
|
||||
|
||||
Reference in New Issue
Block a user