Exemple #1
0
        public CollisionMap(int width, int height)
        {
            Width  = width;
            Height = height;

            PointTree = new QuadTreePointF <PointEntry>(0, 0, Width, Height);
        }
Exemple #2
0
        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());
        }
Exemple #3
0
        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());
        }
Exemple #4
0
        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());
        }
Exemple #5
0
        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());
        }