Exemplo n.º 1
0
 internal Potential(Square square, Group group, Number number,PotentialTypes potentialType)
 {
     this.Square = square;
     this.SquareGroup = group;
     this.Number = number;
     this.PotentialType = potentialType;
 }
Exemplo n.º 2
0
Arquivo: Group.cs Projeto: coni2k/SS
 void Square_NumberBecameUnavailable(Number number)
 {
     CheckPotentialSquare(number);
 }
Exemplo n.º 3
0
Arquivo: Group.cs Projeto: 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));
        }
Exemplo n.º 4
0
Arquivo: Group.cs Projeto: 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;
        }