about summary refs log tree commit diff
diff options
context:
space:
mode:
authorhanemile <hanemile@protonmail.com>2018-10-30 15:31:27 +0100
committerhanemile <hanemile@protonmail.com>2018-10-30 15:31:27 +0100
commit28391110d2e992e148f23934deb95fd208f1ae8d (patch)
treece62211e46cb2ee03a9814875e3e2b431bab3f7c
parent1f1679b276ae1f9f0dccf9fe7572666132b57023 (diff)
added the quadtree structure defining a quadtree and it's node at the
same time by using recursion.
-rw-r--r--structs/structs.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/structs/structs.go b/structs/structs.go
index b4b550a..ea99d96 100644
--- a/structs/structs.go
+++ b/structs/structs.go
@@ -31,3 +31,15 @@ func (boundingBox *boundingBox) containsPoint(point coord) bool {
 	// the point is outside of the cell -> return false
 	return false
 }
+
+// quadtree defining the whole quadtree and a node in itself (recursively)
+type quadtree struct {
+	nodeCapacity int
+	boundary     boundingBox
+
+	// the quadtree leaves
+	northWest *quadtree
+	northEast *quadtree
+	southWest *quadtree
+	southEast *quadtree
+}