PKHeX/PKHeX.Core/Saves/Substructures/Gen7
Kurt 1e86fdcea8
Fracture the encounter matching checks to allow progressive validation (#3137)
## Issue

We want to discard-but-remember any slots that aren't a perfect fit, on the off chance that a better one exists later in the search space. If there's no better match, then we gotta go with what we got.

## Example:
Wurmple exists in area `X`, and also has a more rare slot for Silcoon, with the same level for both slots. 
* We have a Silcoon that we've leveled up a few times.

Was our Silcoon originally a Wurmple, or was it caught as a Silcoon? 
* To be sure, we have to check the EC/PID if the Wurmple wouldn't evolve into Cascoon instead.
* We don't want to wholly reject that Wurmple slot, as maybe the Met Level isn't within Silcoon's slot range.

---

Existing implementation would store "deferred" matches in a list; we only need to keep 1 of these matches around (less allocation!). We also want to differentiate between a "good" deferral and a "bad" deferral; I don't think this is necessary but it's currently used by Mystery Gift matching (implemented for the Eeveelution mystery gifts which matter for evolution moves).

The existing logic didn't use inheritance, and instead had static methods being reused across generations. Quite kludgy. Also, the existing logic was a pain to modify the master encounter yield methods, as one generation's quirks had to not impact all other generations that used the method.

---

The new implementation splits out the encounter yielding methods to be separate for each generation / subset. Now, things don't have to check `WasLink` for Gen7 origin, because Pokémon Link wasn't a thing in Gen7.

---

## Future
Maybe refactoring yielders into "GameCores" that expose yielding behaviors / properties, rather than the static logic. As more generations and side-gamegroups get added (thanks LGPE/GO/GameCube), all this switch stuff gets annoying to maintain instead of just overriding/inheritance.

## Conclusion

This shouldn't impact any legality results negatively; if you notice any regressions, report them! This should reduce false flags where we didn't defer-discard an encounter when we should have (wild area mons being confused with raids).
2021-01-29 17:55:27 -08:00
..
BattleTree7.cs seal hunting 2020-09-07 13:51:13 -07:00
BelugaBlockIndex.cs Add CaptureRecord block interaction 2020-10-08 15:28:25 -07:00
BoxLayout7.cs Simplify ternary byte casts 2020-12-21 16:53:28 -08:00
CaptureRecords.cs moar is or 2020-12-25 12:30:26 -08:00
ConfigSave6.cs Add configsave to accessor 2020-04-26 15:17:58 -07:00
ConfigSave7.cs Add configsave to accessor 2020-04-26 15:17:58 -07:00
ConfigSave7b.cs Add configsave to accessor 2020-04-26 15:17:58 -07:00
Daycare7.cs Simplify ternary byte casts 2020-12-21 16:53:28 -08:00
EventVarType.cs Minor refactoring 2020-09-06 10:53:13 -07:00
EventWork7b.cs Use more expression return style 2021-01-01 17:08:49 -08:00
FashionBlock7.cs Handle more messages 2019-10-27 20:39:15 -07:00
FestaFacility.cs Use more expression return style 2021-01-01 17:08:49 -08:00
FieldMenu7.cs Add RotomAffection and rotoloto1/2 flag editing to GUI 2020-12-29 11:39:19 -08:00
FieldMoveModelSave7.cs PKHeX.Core Nullable cleanup (#2401) 2019-10-16 18:47:31 -07:00
GameTime7.cs Fix SecondsTo* read offset 2019-07-07 08:43:04 -07:00
GoParkStorage.cs Change signatures to use readonly if possible 2020-12-05 06:09:33 -08:00
GP1.cs Fracture the encounter matching checks to allow progressive validation (#3137) 2021-01-29 17:55:27 -08:00
IEventWork.cs Add misc setup objects 2018-11-13 19:16:14 -08:00
JoinFesta7.cs Use StringConverter api consistently; use stringbuilder when possible 2021-01-14 22:50:13 -08:00
Misc7.cs PKHeX.Core Nullable cleanup (#2401) 2019-10-16 18:47:31 -07:00
Misc7b.cs PKHeX.Core Nullable cleanup (#2401) 2019-10-16 18:47:31 -07:00
MyItem.cs Change signatures to use readonly if possible 2020-12-05 06:09:33 -08:00
MyItem7b.cs Change signatures to use readonly if possible 2020-12-05 06:09:33 -08:00
MyItem7SM.cs Change signatures to use readonly if possible 2020-12-05 06:09:33 -08:00
MyItem7USUM.cs Change signatures to use readonly if possible 2020-12-05 06:09:33 -08:00
MyStatus7.cs Remove unnecessary null checks 2020-01-18 16:57:25 -08:00
MyStatus7b.cs PKHeX.Core Nullable cleanup (#2401) 2019-10-16 18:47:31 -07:00
MysteryBlock7.cs Extract metadata/state tracking from SaveFile obj 2020-12-05 05:36:23 -08:00
PlayerBattleStyle7.cs Minor tweaks 2020-09-09 12:47:24 -07:00
PlayerSkinColor7.cs Minor tweaks 2020-09-09 12:47:24 -07:00
PlayTime7b.cs tweak last saved string format 2019-11-26 23:10:28 -08:00
PokeFinder7.cs PKHeX.Core Nullable cleanup (#2401) 2019-10-16 18:47:31 -07:00
PokeListHeader.cs spec->species 2020-12-28 22:22:52 -08:00
PouchSize7b.cs Add misc setup objects 2018-11-13 19:16:14 -08:00
QR7.cs Revise some method signatures 2020-12-22 20:50:33 -08:00
ResortSave7.cs Remove unnecessary null checks 2020-01-18 16:57:25 -08:00
SAV7BlockIndex.cs Move files to their correct location 2020-05-24 17:11:39 -07:00
SaveBlock.cs Minor clean 2020-12-21 17:48:08 -08:00
Situation7.cs Simplify block property names 2019-10-18 20:42:03 -07:00
Stamp7.cs Add missing stamp 2019-03-29 09:40:31 -07:00
WB7Records.cs Minor clean 2020-11-11 21:01:41 -08:00
WormholeInfoReader.cs moar is or 2020-12-25 12:30:26 -08:00
WR7GiftType.cs Split up WR7 to separate files 2018-12-29 22:09:27 -08:00