Example #1
0
    /// <summary>
    /// Recursively draws the limits on the texture
    /// </summary>
    /// <param name="texture">The texture to draw on</param>
    public void DrawLimits(Texture2D texture)
    {
        // If each node exists we recall draw on it
        if (_northEast != null)
        {
            _northEast.DrawLimits(texture);
        }
        if (_northWest != null)
        {
            _northWest.DrawLimits(texture);
        }
        if (_southEast != null)
        {
            _southEast.DrawLimits(texture);
        }
        if (_southWest != null)
        {
            _southWest.DrawLimits(texture);
        }

        // But if there is no child we draw the  current node's box
        if (_northEast == null && _northWest == null && _southEast == null && _southWest == null)
        {
            _box.Draw(texture);
        }
    }
Example #2
0
 /// <summary>
 /// Draws the limits of the tree
 /// </summary>
 public void DrawTreeLimits()
 {
     _tree.DrawLimits(_texture);
 }