using System; using System.Diagnostics.CodeAnalysis; namespace PKHeX.Core; /// public sealed class ComplexSet([ConstantExpected] string PropertyName, Action Action) : IComplexSet { public readonly string PropertyName = PropertyName; public readonly Func, bool> IsValueCompatible = _ => true; public ComplexSet([ConstantExpected] string PropertyName, Func, bool> criteria, Action Action) : this(PropertyName, Action) => IsValueCompatible = criteria; public bool IsMatch(ReadOnlySpan name, ReadOnlySpan value) => name.SequenceEqual(PropertyName) && IsValueCompatible(value); public void Modify(PKM pk, StringInstruction instr) => Action(pk, instr); }