private static void CheckTopCell(CellInLabyrinth current, string[,] labyrinth, string currentWave, Queue<CellInLabyrinth> cells) { if (current.Row > 0) { if (labyrinth[current.Row - 1, current.Column] == "0") { var topCell = new CellInLabyrinth(current.Row - 1, current.Column, currentWave); cells.Enqueue(topCell); labyrinth[current.Row - 1, current.Column] = currentWave; } } }
private static void CheckBottomCell(CellInLabyrinth current, string[,] labyrinth, string currentWave, Queue<CellInLabyrinth> cells) { if (current.Row < labyrinth.GetLength(0) - 1) { if (labyrinth[current.Row + 1, current.Column] == "0") { var bottomCell = new CellInLabyrinth(current.Row + 1, current.Column, currentWave); cells.Enqueue(bottomCell); labyrinth[current.Row + 1, current.Column] = currentWave; } } }
private static void CheckLeftCell(CellInLabyrinth current, string[,] labyrinth, string currentWave, Queue<CellInLabyrinth> cells) { if (current.Column > 0) { if (labyrinth[current.Row, current.Column - 1] == "0") { var leftCell = new CellInLabyrinth(current.Row, current.Column - 1, currentWave); cells.Enqueue(leftCell); labyrinth[current.Row, current.Column - 1] = currentWave; } } }
private static void CheckRightCell(CellInLabyrinth current, string[,] labyrinth, string currentWave, Queue<CellInLabyrinth> cells) { if (current.Column < labyrinth.GetLength(1) - 1) { if (labyrinth[current.Row, current.Column + 1] == "0") { var rightCell = new CellInLabyrinth(current.Row, current.Column + 1, currentWave); cells.Enqueue(rightCell); labyrinth[current.Row, current.Column + 1] = currentWave; } } }