mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-07-21 09:20:21 -05:00
really not a fan of the abstract class, probably better to rewrite everything another day to be less dumb bug was due to the trickle-down then clearing; object references ended up being duplicated when Unobtainable item placeholders were removed from the pouch and things trickled. don't bother removing unreleased item data if its quantity is 0.
35 lines
1.0 KiB
C#
35 lines
1.0 KiB
C#
namespace PKHeX.Core;
|
|
|
|
/// <summary>
|
|
/// Commonly reused frame details for checking encounter frames being possible to obtain.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// By precomputing the seeds, we can avoid having to calculate them on the fly for every lead scenario check.
|
|
/// </remarks>
|
|
public readonly ref struct FrameCheckDetails<T>
|
|
{
|
|
public readonly T Encounter;
|
|
public readonly byte LevelMin;
|
|
public readonly byte LevelMax;
|
|
public readonly uint Seed1;
|
|
public readonly uint Seed2;
|
|
public readonly uint Seed3;
|
|
public readonly byte Format;
|
|
|
|
public uint Seed4 => LCRNG.Prev(Seed3);
|
|
public uint Prev1 => Seed1 >> 16;
|
|
public uint Prev2 => Seed2 >> 16;
|
|
public uint Prev3 => Seed3 >> 16;
|
|
|
|
public FrameCheckDetails(T enc, uint seed, byte levelMin, byte levelMax, byte format)
|
|
{
|
|
Encounter = enc;
|
|
LevelMin = levelMin;
|
|
LevelMax = levelMax;
|
|
Format = format;
|
|
seed = Seed1 = LCRNG.Prev(seed);
|
|
seed = Seed2 = LCRNG.Prev(seed);
|
|
Seed3 = LCRNG.Prev(seed);
|
|
}
|
|
}
|