mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 06:20:25 +00:00
34 lines
926 B
C#
34 lines
926 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(LeadSeed other) => Lead > other.Lead;
|
|
}
|