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)); } }
public SearchActivity(CellPosition cellVisited, bool partOfCorrectWay) { this.cellVisited = cellVisited; this.partOfCorrectWay = partOfCorrectWay; }
public void AddToMaze(CellPosition cell) { StateFromIdent(cell).BelongsToMaze = true; }
public CellState StateFromIdent(CellPosition cell) { return(cells[cell.Y, cell.X]); }
public void DefaultUnmark(CellPosition frontier) { DefaultMarkedList.Remove(frontier); StateFromIdent(frontier).Mark = NO_MARK; }