Пример #1
0
        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));
        }
Пример #2
0
 public static Variant Convert(this Generic.Variant value) =>
 value.IsAmericanCheckers ? Variant.AmericanCheckers : Variant.PoolCheckers;