Example #1
0
 internal Potential(Square square, Group group, Number number,PotentialTypes potentialType)
 {
     this.Square = square;
     this.SquareGroup = group;
     this.Number = number;
     this.PotentialType = potentialType;
 }
Example #2
0
File: Group.cs Project: coni2k/SS
 void Square_NumberBecameUnavailable(Number number)
 {
     CheckPotentialSquare(number);
 }
Example #3
0
File: Group.cs Project: coni2k/SS
        /// <summary>
        /// Checks for potential square
        /// </summary>
        /// <param name="number"></param>
        void CheckPotentialSquare(Number number)
        {
            Square potentialSquare = GetPotentialSquare(number);

            //If there is a potential, raise an event to let Sudoku class to add this potential to the list
            if (potentialSquare != null)
                PotentialFound(new Potential(potentialSquare, this, number, PotentialTypes.Group));
        }
Example #4
0
File: Group.cs Project: coni2k/SS
        internal Square GetPotentialSquare(Number number)
        {
            //If there is already a square which has this number, ignore this alert
            if (_Squares.Exists(s => s.Number.Equals(number)))
                return null;

            //Get the list of squares which are available
            var list = _Squares.Where(s => s.IsAvailable && s.AvailableNumbers.Contains(number)).ToList();

            //If there is only one, set it as potential
            if (list.Count().Equals(1))
                return list[0];

            return null;
        }