/// <summary>
        /// Returns an outline shape based on another maze.
        /// </summary>
        /// <param name="r"></param>
        /// <param name="xSize"></param>
        /// <param name="ySize"></param>
        /// <returns></returns>
        public static OutlineShape CreateInstance(Random r, int xSize, int ySize)
        {
            int wallWidth, gridWidth;

            if (r.Next(2) == 0)
            {
                // One square wide walls, wide squares.
                wallWidth = 1;
                gridWidth = 1 + r.Next(4, 8 + 1);
            }
            else
            {
                // Walls and squares of equal width.
                wallWidth = r.Next(1, 4 + 1);
                gridWidth = wallWidth * 2;
            }
            MazeOutlineShape result = new MazeOutlineShape(xSize, ySize, wallWidth, gridWidth, MazeBuilder.Instance);

            // The shape is implemented in the underlying ExplicitOulineShape.
            return(result.baseShape);
        }
Exemple #2
0
 /// <summary>
 /// Create an outline shape.
 /// </summary>
 /// <param name="r"></param>
 /// <param name="xSize"></param>
 /// <param name="ySize"></param>
 /// <param name="centerX"></param>
 /// <param name="centerY"></param>
 /// <param name="shapeSize"></param>
 /// <returns></returns>
 public static OutlineShape Maze(Random r, int xSize, int ySize, double centerX, double centerY, double shapeSize)
 {
     return(MazeOutlineShape.CreateInstance(r, xSize, ySize));
 }