Ejemplo n.º 1
0
 private WindowEvent(Pane root, Rectangle bounds, Color?backgroundColor, bool openEvent = false)
 {
     Root            = root;
     Bounds          = bounds;
     BackgroundColor = backgroundColor;
     OpenEvent       = openEvent;
 }
Ejemplo n.º 2
0
 public override void Clear(Rectangle bounds)
 {
     for (int i = bounds.MinExtentY; i < bounds.MaxExtentY; i++)
     {
         for (int j = bounds.MinExtentX; j < bounds.MaxExtentX; j++)
         {
             SetGlyph(i, j, Glyph.Blank);
         }
     }
 }
Ejemplo n.º 3
0
        public void CreateRooms()
        {
            var random = SingletonRandom.DefaultRNG;
            var rooms  = new List <Rectangle>();

            // create the rooms for this leaf if it's already been split
            if (LeftChild != null || RightChild != null)
            {
                LeftChild?.CreateRooms();
                RightChild?.CreateRooms();
            }
            else
            {
                // room can be between 3x3 tiles to the size of the leaf - 2
                var roomSize = new Point(random.Next(3, Width - 2), random.Next(3, Height - 2));
                // place room in the leaf but don't allow it to butt up against side of leaf
                var roomPos = new Point(random.Next(1, Width - roomSize.X - 1),
                                        random.Next(1, Height - roomSize.Y - 1));
                Room = new Rectangle(roomPos.X, roomPos.Y, roomSize.X, roomSize.Y);
            }
        }
Ejemplo n.º 4
0
 public static WindowEvent Open(Pane root, Rectangle bounds, Color?backgroundColor = null)
 {
     return(new WindowEvent(root, bounds, backgroundColor, true));
 }
Ejemplo n.º 5
0
 public override void Clear(GoRogue.Rectangle bounds)
 {
     Terminal.Layer(Layer);
     Terminal.ClearArea(bounds);
 }
Ejemplo n.º 6
0
 public abstract void Clear(Rectangle bounds);