QTNode<T>
Namespace: Murder.Core.Physics
Assembly: Murder.dll
public class QTNode<T>
⭐ Constructors
public QTNode<T>(int level, Rectangle bounds)
Parameters
level
int
bounds
Rectangle
⭐ Properties
Bounds
public readonly Rectangle Bounds;
Returns
Rectangle
Entities
public readonly Dictionary<TKey, TValue> Entities;
Entities are indexed by their entity ID number
Returns
Dictionary<TKey, TValue>
Level
public readonly int Level;
Returns
int
Nodes
public ImmutableArray<T> Nodes;
Returns
ImmutableArray<T>
⭐ Methods
Remove(int)
public bool Remove(int entityId)
Removes an entity from the quadtree
Parameters
entityId
int
Returns
bool
Clear()
public void Clear()
Recursively clears all entities of the node, but keeps the structure
DrawDebug(Batch2D)
public void DrawDebug(Batch2D spriteBatch)
Parameters
spriteBatch
Batch2D
Insert(int, T, Rectangle)
public void Insert(int entityId, T info, Rectangle boundingBox)
Parameters
entityId
int
info
T
boundingBox
Rectangle
Reset()
public void Reset()
Completely resets the node removing anything inside
Retrieve(Rectangle, List)
public void Retrieve(Rectangle boundingBox, List<T> returnEntities)
Parameters
boundingBox
Rectangle
returnEntities
List<T>
Split()
public void Split()
⚡