public CollisionMap(int width, int height) { Width = width; Height = height; PointTree = new QuadTreePointF <PointEntry>(0, 0, Width, Height); }
public void TestListQueryEnum() { QuadTreePointF<QTreeObject> qtree = new QuadTreePointF<QTreeObject>(); qtree.AddRange(new List<QTreeObject> { new QTreeObject(new PointF(10,10)), new QTreeObject(new PointF(-1000,1000)) }); var list = qtree.EnumObjects(new RectangleF(9, 9, 20, 20)); Assert.AreEqual(1, list.Count()); }
public void TestListGetAll() { QuadTreePointF<QTreeObject> qtree = new QuadTreePointF<QTreeObject>(); qtree.AddRange(new List<QTreeObject> { new QTreeObject(new PointF(10,10)), new QTreeObject(new PointF(-1000,1000)) }); var list = qtree.GetAllObjects(); Assert.AreEqual(2, list.Count()); }
public void TestListGetAll() { QuadTreePointF <QTreeObject> qtree = new QuadTreePointF <QTreeObject>(); qtree.AddRange(new List <QTreeObject> { new QTreeObject(new PointF(10, 10)), new QTreeObject(new PointF(-1000, 1000)) }); var list = qtree.GetAllObjects(); Assert.AreEqual(2, list.Count()); }
public void TestListQueryEnum() { QuadTreePointF <QTreeObject> qtree = new QuadTreePointF <QTreeObject>(); qtree.AddRange(new List <QTreeObject> { new QTreeObject(new PointF(10, 10)), new QTreeObject(new PointF(-1000, 1000)) }); var list = qtree.EnumObjects(new RectangleF(9, 9, 20, 20)); Assert.AreEqual(1, list.Count()); }