PKHeX/PKHeX.Core/Legality/Structures/CheckIdentifier.cs

162 lines
4.6 KiB
C#
Raw Normal View History

namespace PKHeX.Core;
/// <summary> Identification flair for what properties a <see cref="CheckResult"/> pertains to </summary>
public enum CheckIdentifier : byte
Refactor encounter matching exercise in deferred execution/state machine, only calculate possible matches until a sufficiently valid match is obtained. Previous setup would try to calculate the 'best match' and had band-aid workarounds in cases where a subsequent check may determine it to be a false match. There's still more ways to improve speed: - precalculate relationships for Encounter Slots rather than iterating over every area - yielding individual slots instead of an entire area - group non-egg wondercards by ID in a dict/hashtable for faster retrieval reworked some internals: - EncounterMatch is always an IEncounterable instead of an object, for easy pattern matching. - Splitbreed checking is done per encounter and is stored in the EncounterEgg result - Encounter validation uses Encounter/Move/RelearnMove/Evolution to whittle to the final encounter. As a part of the encounter matching, a lazy peek is used to check if an invalid encounter should be retained instead of discarded; if another encounter has not been checked, it'll stop the invalid checks and move on. If it is the last encounter, no other valid encounters exist so it will keep the parse for the invalid encounter. If no encounters are yielded, then there is no encountermatch. An EncounterInvalid is created to store basic details, and the parse is carried out. Breaks some legality checking features for flagging invalid moves in more detail, but those can be re-added in a separate check (if splitbreed & any move invalid -> check for other split moves). Should now be easier to follow the flow & maintain :smile:
2017-05-28 04:17:53 +00:00
{
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM.Moves"/>.
/// </summary>
CurrentMove,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM.RelearnMoves"/>.
/// </summary>
RelearnMove,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM"/>'s matched encounter information.
/// </summary>
Encounter,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM.IsShiny"/> status.
/// </summary>
Shiny,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM.EncryptionConstant"/>.
/// </summary>
EC,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM.PID"/>.
/// </summary>
PID,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM.Gender"/>.
/// </summary>
Gender,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="EffortValues"/>.
/// </summary>
EVs,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM.Language"/>.
/// </summary>
Language,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM.Nickname"/>.
/// </summary>
Nickname,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM.OT_Name"/>, <see cref="PKM.TID16"/>, or <see cref="PKM.SID16"/>.
/// </summary>
Trainer,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM.IVs"/>.
/// </summary>
IVs,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM.Met_Level"/> or <see cref="PKM.CurrentLevel"/>.
/// </summary>
Level,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM.Ball"/>.
/// </summary>
Ball,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM"/> memory data.
/// </summary>
Memory,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM"/> geography data.
/// </summary>
Geography,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM.Form"/>.
/// </summary>
Form,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM.IsEgg"/> status.
/// </summary>
Egg,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM"/> miscellaneous properties.
/// </summary>
Misc,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM.FatefulEncounter"/>.
/// </summary>
Fateful,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM"/> ribbon data.
/// </summary>
Ribbon,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM"/> super training data.
/// </summary>
Training,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM.Ability"/>.
/// </summary>
Ability,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM"/> evolution chain relative to the matched encounter.
/// </summary>
Evolution,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM.Nature"/>.
/// </summary>
Nature,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM"/>'s <see cref="PKM.Version"/> compatibility.
/// <remarks>This is used for parsing checks to ensure the <see cref="PKM"/> didn't debut on a future <see cref="PKM.Generation"/></remarks>
/// </summary>
GameOrigin,
/// <summary>
/// The CheckResult pertains to the <see cref="PKM.HeldItem"/>.
/// </summary>
HeldItem,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM"/> <see cref="IRibbonSetMark8"/>.
/// </summary>
RibbonMark,
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="IGanbaru"/> values.
/// </summary>
GVs,
/// <summary>
/// The <see cref="CheckResult"/> pertains to <see cref="PKM.MarkValue"/> values.
/// </summary>
Marking,
2022-07-10 22:53:33 +00:00
/// <summary>
/// The <see cref="CheckResult"/> pertains to the <see cref="PKM"/> <see cref="IAwakened"/> values.
/// </summary>
AVs,
Refactor encounter matching exercise in deferred execution/state machine, only calculate possible matches until a sufficiently valid match is obtained. Previous setup would try to calculate the 'best match' and had band-aid workarounds in cases where a subsequent check may determine it to be a false match. There's still more ways to improve speed: - precalculate relationships for Encounter Slots rather than iterating over every area - yielding individual slots instead of an entire area - group non-egg wondercards by ID in a dict/hashtable for faster retrieval reworked some internals: - EncounterMatch is always an IEncounterable instead of an object, for easy pattern matching. - Splitbreed checking is done per encounter and is stored in the EncounterEgg result - Encounter validation uses Encounter/Move/RelearnMove/Evolution to whittle to the final encounter. As a part of the encounter matching, a lazy peek is used to check if an invalid encounter should be retained instead of discarded; if another encounter has not been checked, it'll stop the invalid checks and move on. If it is the last encounter, no other valid encounters exist so it will keep the parse for the invalid encounter. If no encounters are yielded, then there is no encountermatch. An EncounterInvalid is created to store basic details, and the parse is carried out. Breaks some legality checking features for flagging invalid moves in more detail, but those can be re-added in a separate check (if splitbreed & any move invalid -> check for other split moves). Should now be easier to follow the flow & maintain :smile:
2017-05-28 04:17:53 +00:00
}