예제 #1
0
        public void TraverseTest()
        {
            var qt = new RegionQuadtree <int>(2);

            qt.Set(new Point2i(0, 0), 1);
            qt.Set(new Point2i(1, 0), 2);
            var t = qt.Traverse().ToList();

            Assert.Equal(2, t.Count);

            qt = new RegionQuadtree <int>(3);
            qt.Set(new Point2i(0, 0), 1);
            qt.Set(new Point2i(7, 7), 2);
            qt.Set(new Point2i(1, 0), 1);
            qt.Set(new Point2i(0, 5), 2);
            qt.Set(new Point2i(3, 6), 2);
            t = qt.Traverse().ToList();
            Assert.Equal(5, t.Count);
        }