Exemple #1
0
 public AnalyzerCanvas(int numRows, int numColumns, AnalyzerCanvasNode[] nodes)
 {
     this.currentPosition = new RowColumnPosition(0, 0);
     this.numRows = numRows;
     this.numColumns = numColumns;
     this.nodes = nodes;
 }
Exemple #2
0
 private AnalyzerCanvasNode this[RowColumnPosition position]
 {
     get { return nodes[position.Row * numColumns + position.Column]; }
 }
Exemple #3
0
 private bool TryMove(RowColumnPosition position)
 {
     if (position.Row < 0 || position.Row >= numRows)
     {
         return false;
     }
     else if (position.Column < 0 || position.Column >= numColumns)
     {
         return false;
     }
     else if (this[position].IsVisited)
     {
         return false;
     }
     else if (this[position].IsWhite)
     {
         return false;
     }
     else
     {
         currentPosition = position;
         return true;
     }
 }
Exemple #4
0
 private void ForceMove(RowColumnPosition position)
 {
     if (position.Row < 0 || position.Row >= numRows)
     {
         throw new ArgumentOutOfRangeException("position.Row");
     }
     else if (position.Column < 0 || position.Column >= numColumns)
     {
         throw new ArgumentOutOfRangeException("position.Column");
     }
     else
     {
         currentPosition = position;
     }
 }