mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-18 22:38:38 +00:00
35 lines
929 B
C#
35 lines
929 B
C#
|
using static PKHeX.Core.LeadRequired;
|
||
|
|
||
|
namespace PKHeX.Core;
|
||
|
|
||
|
/// <summary>
|
||
|
/// Result wrapper for encounter lead information.
|
||
|
/// </summary>
|
||
|
public struct LeadSeed(uint Seed, LeadRequired Lead)
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// Seed the encounter was triggered from.
|
||
|
/// </summary>
|
||
|
public uint Seed = Seed;
|
||
|
|
||
|
/// <summary>
|
||
|
/// Lead condition required for the encounter.
|
||
|
/// </summary>
|
||
|
public LeadRequired Lead = Lead;
|
||
|
|
||
|
public readonly void Deconstruct(out uint seed, out LeadRequired lead)
|
||
|
{
|
||
|
seed = Seed;
|
||
|
lead = Lead;
|
||
|
}
|
||
|
|
||
|
public readonly bool IsNoRequirement() => Lead == None;
|
||
|
public readonly bool IsNoAbilityLead() => Lead == None;
|
||
|
public readonly bool IsValid() => Lead != Invalid;
|
||
|
|
||
|
/// <summary>
|
||
|
/// Prefers the lead with the most likely value (lowest value).
|
||
|
/// </summary>
|
||
|
public readonly bool IsBetterThan(in LeadSeed other) => Lead > other.Lead;
|
||
|
}
|