예제 #1
0
        public static bool IsStraight(Maze maze, int x, int y)
        {
            if (!(y == 0 || x == 0 || y == maze.height - 1 || x == maze.width - 1))
            {
                if (!maze.GetPixel(x - 1, y) && !maze.GetPixel(x + 1, y) ||
                    !maze.GetPixel(x, y - 1) && !maze.GetPixel(x, y + 1))
                {
                    return(true);
                }
            }

            return(false);
        }
예제 #2
0
 //Used to check if the pixel is a wall
 public static bool IsWall(Maze maze, int x, int y)
 {
     return(maze.GetPixel(x, y));
 }