ShowdownSet: Lessen allocation
MoveTutor: Remove boxing by calling the generic method instead of object method
Xoro8b: Add more xmldoc, use positive constant instead of inverse negative for parity
StadiumUtil: Use built-in endianness reversal methods
Many years ago, PKX used to be a >4,000 line bloated file, which spun off multiple classes like CommonEdits and most of the early non-GUI PKM related logic. Now, it's just a stub to source the latest generation & personal table.
Separate files = more concise info, and more room to grow to do more advanced things.
Makes the IsPresent methods public (no longer internal).
Single underscore discards (one of the c# language revisions allowed reusing the single underscore discard).
Remove a temporary allocation in BDSP flag editor
Instantiating from template now follows group seed -> spawn 1 correlation, including alpha move.
Differentiates static encounters that don't follow the ow8a correlation, scrambles EC to disassociate.
Adds rand64 to get initial seeds
Set correct level range to match slotSeed; not respecting the slot roll being valid, but whatever.
Adds structures to read/write saved spawner data such as seeds, counts.
Adds generator and validator to emulate the FixInitSpec builder used by the game logic
Similar to SW/SH raids, validating these in-process is not feasible due to the number crunching required.
This does not handle the encounter slot call or the follow-up level range call. Just the inner FixInitSpec ctor & fill.
level is calc'd:
randFloat(sum) -> slot float
rand.Next() -> gen_seed (for all the details)
rand.NextInt(delta) +min -> level
Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
Existing `get`/`set` logic is flawed in that it doesn't work on Big Endian operating systems, and it allocates heap objects when it doesn't need to.
`System.Buffers.Binary.BinaryPrimitives` in the `System.Memory` NuGet package provides both Little Endian and Big Endian methods to read and write data; all the `get`/`set` operations have been reworked to use this new API. This removes the need for PKHeX's manual `BigEndian` class, as all functions are already covered by the BinaryPrimitives API.
The `StringConverter` has now been rewritten to accept a Span to read from & write to, no longer requiring a temporary StringBuilder.
Other Fixes included:
- The Super Training UI for Gen6 has been reworked according to the latest block structure additions.
- Cloning a Stadium2 Save File now works correctly (opening from the Folder browser list).
- Checksum & Sanity properties removed from parent PKM class, and is now implemented via interface.
shininess unrelated to your trainer ID, lol
probably also applies to other predetermined encounters like underground and radar, but those aren't EC-seed regenerated (?)
Remove unused interface declaration
Big thanks to @SciresM @sora10pls @Lusamine @architdate @ReignOfComputer for testing and contributing code / test cases. Can't add co-authors from the PR menu :(
Builds will fail because azure pipelines not yet updated with net6.
Iterate over all possible seed frames that yield the IV pattern; nature is right before IV rands (PID is algorithmic from gender ratio and prior nature call).
Split up GetFrames into stepwise methods, clean up parameter passing