Esempio n. 1
0
        public void RemoveNumber(int number, string reason)
        {
            if (!Number.HasValue && PossibleNumbers.Any(f => f == number))
            {
                PossibleNumbers.Remove(number);

                if (PossibleNumbers.Count == 1)
                {
                    SetValue(PossibleNumbers.Single(), "Only other Number left after remmove: " + reason);
                }
                else if (PossibleNumbers.Count == 2)
                {
                    RaisePairLeft(false, reason);
                }
            }
        }
Esempio n. 2
0
        public void SetValue(int value, string reason, bool isInit = false)
        {
            if (PossibleNumbers.Contains(value))
            {
                Number = value;

                PossibleNumbers.Clear();
                PossibleNumbers.Add(value);

                if (!isInit)
                {
                    RaiseFindMatch(false, reason);
                }
            }
            else
            {
                throw new Exception("Invalid Value");
            }
        }