Example #1
0
    /// <summary>
    /// Recursively draw the rooms
    /// </summary>
    /// <param name="texture">The texture to draw on</param>
    public void DrawRoom(Texture2D texture)
    {
        // If children exist, call DrawRoom to em
        if (_northEast != null)
        {
            _northEast.DrawRoom(texture);
        }
        if (_northWest != null)
        {
            _northWest.DrawRoom(texture);
        }
        if (_southEast != null)
        {
            _southEast.DrawRoom(texture);
        }
        if (_southWest != null)
        {
            _southWest.DrawRoom(texture);
        }

        // Else draw current's node room
        if (_northEast == null && _northWest == null && _southEast == null && _southWest == null)
        {
            _room.Draw(texture);
        }
    }
Example #2
0
 /// <summary>
 /// Draws the rooms of the tree
 /// </summary>
 public void DrawTreeRooms()
 {
     _tree.DrawRoom(_texture);
 }