public static Variant Convert(this Generic.Variant value) { if (value.IsAmericanCheckers) { return(Variant.AmericanCheckers); } else if (value.IsPoolCheckers) { return(Variant.PoolCheckers); } else if (value.IsAmericanCheckersOptionalJump) { return(Variant.AmericanCheckersOptionalJump); } throw new ArgumentException("Unknown variant", nameof(value)); }
public static Variant Convert(this Generic.Variant value) => value.IsAmericanCheckers ? Variant.AmericanCheckers : Variant.PoolCheckers;