Пример #1
0
        public void Cells()
        {
            var map = new SpatialMap <int>(10);

            Assert.Empty(map.Cells(new AABB(0, 0, 1, 1)));

            // Realize the cells first so all the cell "seeding" occurs.
            var newCells      = map.Cells(new AABB(0, 0, 1, 1), true).ToList();
            var existingCells = map.Cells(new AABB(0, 0, 1, 1)).ToList();

            SequenceEqual(newCells, existingCells);

            Assert.Equal(4, new SpatialMap <int>(10).Cells(new AABB(-1, -1, 2, 2), true).Count());

            Assert.Equal(4, new SpatialMap <int>(1).Cells(new AABB(-0.5f, 0.5f, 3, 1), true).Count());
        }