public void WhiteQuadEnumeration() { var qt = new RegionQuadtree <int>(3); qt.Set(new Point2i(0, 0), 1); Assert.Equal(1, qt.Count()); Assert.Equal(1, qt.ElementAt(0)); qt.Set(new Point2i(4, 4), 2); Assert.Equal(2, qt.Count()); Assert.Equal(1, qt.ElementAt(0)); Assert.Equal(2, qt.ElementAt(1)); }
public void BlackQuadEnumeration() { var qt = new RegionQuadtree <int>(3); qt.Set(1); Assert.Equal(1, qt.Count()); Assert.Equal(1, qt.ElementAt(0)); qt.Set(new Point2i(0, 0), 2); Assert.True(qt.Contains(2)); Assert.Equal(10, qt.Count()); Assert.Equal(9, qt.Count((i) => i == 1)); }