private void SetPath(int x, int y) { _maze[x, y] = MazeConstants.Path; if (x % 2 == 1 && y % 2 == 1) { StartCells.Add(new Location(x, y)); } }
private Location GetStartCell() { if (StartCells.Count == 0) { return(new Location(-1, -1)); } // ランダムに取得 var r = new Random(); var index = r.Next(StartCells.Count); var cell = StartCells[index]; StartCells.RemoveAt(index); return(cell); }