using System;
namespace PKHeX.Core;
///
/// Links a to the source and that the method can be triggered from.
///
public struct EvolutionLink
{
private Func? IsBanned = null;
public readonly EvolutionMethod Method;
public readonly ushort Species;
public readonly byte Form;
public EvolutionLink(ushort species, byte form, EvolutionMethod method)
{
Species = species;
Form = form;
Method = method;
}
public bool IsEmpty => Species == 0;
public (ushort Species, byte Form) Tuple => (Species, Form);
public void Ban(Func check) => IsBanned = check;
///
/// Checks if the is allowed.
///
/// Entity to check
/// True if banned, false if allowed.
public bool IsEvolutionBanned(PKM pk) => IsBanned != null && IsBanned(pk);
}