Add QuadTree toString() and getChildCountAtPos()
This commit is contained in:
@@ -529,7 +529,7 @@ public class QuadTreeTest
|
||||
QuadNode<Integer> rootNode = new QuadNode<>(new DhSectionPos((byte)10, 0, 0), (byte)0);
|
||||
rootNode.forEachDirectChild((child, childPos) ->
|
||||
{
|
||||
rootNode.setValue(childPos, 1, null);
|
||||
rootNode.setValue(childPos, 1);
|
||||
});
|
||||
Assert.assertEquals("node not filled", rootNode.getChildValueCount(), 4);
|
||||
|
||||
@@ -543,6 +543,18 @@ public class QuadTreeTest
|
||||
|
||||
}
|
||||
|
||||
// this is here for quickly testing the toString method, it should never fail
|
||||
@Test
|
||||
public void toStringTest()
|
||||
{
|
||||
QuadTree<Integer> tree = new QuadTree<>(ROOT_NODE_WIDTH_IN_BLOCKS, new DhBlockPos2D(0, 0), (byte)6);
|
||||
|
||||
String treeString = tree.toString();
|
||||
Assert.assertNotNull(treeString);
|
||||
Assert.assertNotEquals("", treeString);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user