class Quad (Niantic.ARDK.Extensions.Gameboard.SpatialTree.Quad)

Overview

class Quad {
public:
    // properties

    Bounds Bounds;
    bool HasElements;
    bool IsLeaf;

    // methods

    IEnumerable<Quad> GetChildren();
    bool GetElement(Vector2Int atCoordinates, out GridNode result);
    IEnumerable<GridNode> GetElements();
    IEnumerable<GridNode> GetElements(Bounds withinBounds);
    IEnumerable<GridNode> GetNeighbours(Vector2Int toCoordinates);
    bool Insert(GridNode node);
    Quad(Vector2Int origin, int rank);
    bool Remove(GridNode node);
};

Detailed Documentation

Properties

bool IsLeaf

Returns whether this quad is a leaf bucket.

Methods

IEnumerable<Quad> GetChildren()

Returns the child quadrants of this parent.

IEnumerable<GridNode> GetElements()

Returns all points in the area defined by the quad boundaries.

IEnumerable<GridNode> GetElements(Bounds withinBounds)

Returns elements of this quad within the specified boundaries.

Parameters:

withinBounds

The enclosing boundaries.

Returns:

A new list of stored elements within the specified bounds.

bool Insert(GridNode node)

Inserts a new item into this quad.

Quad(Vector2Int origin, int rank)

Allocates a new quad.

Parameters:

origin

The center of the quad.

rank

Determines the number of subdivisions possible (rank - 1)

bool Remove(GridNode node)

Removes an item from this quad, if contained.