예제 #1
0
 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));
     }
 }
예제 #2
0
        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);
        }