Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Test
- public void TestMethod3() {
- QuadTree<TestBox> quadTree = new QuadTree<>(WorldWidth, WorldHeight);
- List<List<TestBox>> items = new ArrayList<>();
- List<TestBox> t1 = new ArrayList<>();
- t1.add(new TestBox(110, 0));
- List<TestBox> t2 = new ArrayList<>();
- t2.add(new TestBox(10, 0));
- List<TestBox> t3 = new ArrayList<>();
- t3.add(new TestBox(10, 0));
- t3.add(new TestBox(10, 110));
- items.add(t1);
- items.add(t2);
- items.add(t3);
- for (List<TestBox> item : items) {
- for (TestBox testBox : item) {
- quadTree.insert(testBox);
- }
- }
- ...
- Rectangle thirdQuadrant = GetSubquadrantBounds(3);
- List<TestBox> elementsThird = quadTree.report(thirdQuadrant);
- index = 0;
- for (TestBox testBox : items.get(2)) {
- Assert.assertEquals(testBox, elementsThird.get(index++));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement