Class GridLookup
Holds a lookup datastructure to quickly find objects inside rectangles.
Objects of type T occupy an integer rectangle in the grid and they can be moved efficiently. You can query for all objects that touch a specified rectangle that runs in O(m*k) time where m is the number of objects that the query returns and k is the average number of cells that an object occupies.
All objects must be contained within a rectangle with one point at the origin (inclusive) and one at size (exclusive) that is specified in the constructor.
Inner Types
Public Methods
Add an object to the lookup data structure.
Move an object to occupy a new set of cells.
Returns all objects of a specific type inside the cells marked by the rectangle.
Removes an item from the lookup data structure.
Public Variables
Linked list of all items.
Private/Protected Members
Linked list of all items.