示例#1
0
 public IEnumerable <CellPosition> YieldNeighbours(CellPosition c)
 {
     if (c.Y > 0)
     {
         yield return(new CellPosition(c.X, c.Y - 1));
     }
     if (c.Y < height - 1)
     {
         yield return(new CellPosition(c.X, c.Y + 1));
     }
     if (c.X > 0)
     {
         yield return(new CellPosition(c.X - 1, c.Y));
     }
     if (c.X < width - 1)
     {
         yield return(new CellPosition(c.X + 1, c.Y));
     }
 }
示例#2
0
 public SearchActivity(CellPosition cellVisited, bool partOfCorrectWay)
 {
     this.cellVisited      = cellVisited;
     this.partOfCorrectWay = partOfCorrectWay;
 }
示例#3
0
 public void AddToMaze(CellPosition cell)
 {
     StateFromIdent(cell).BelongsToMaze = true;
 }
示例#4
0
 public CellState StateFromIdent(CellPosition cell)
 {
     return(cells[cell.Y, cell.X]);
 }
示例#5
0
 public void DefaultUnmark(CellPosition frontier)
 {
     DefaultMarkedList.Remove(frontier);
     StateFromIdent(frontier).Mark = NO_MARK;
 }