about summary refs log tree commit diff
path: root/quadtree.go
diff options
context:
space:
mode:
authorhanemile <hanemile@protonmail.com>2019-01-12 21:32:11 +0100
committerhanemile <hanemile@protonmail.com>2019-01-12 21:32:11 +0100
commitaf81b075036ac7c581321f587a06576650dec331 (patch)
tree448be79c34d079a96a85e4ea3ddcb831c29ee7e9 /quadtree.go
parent30fecdeaef86a04cad7a9f93a31ae9856ad4e473 (diff)
added json attributes to objects
Diffstat (limited to 'quadtree.go')
-rw-r--r--quadtree.go12
1 files changed, 3 insertions, 9 deletions
diff --git a/quadtree.go b/quadtree.go
index eaca299..a9e60e6 100644
--- a/quadtree.go
+++ b/quadtree.go
@@ -1,7 +1,6 @@
 package structs
 
 import (
-	"encoding/json"
 	"fmt"
 	"io/ioutil"
 	"os/exec"
@@ -170,19 +169,14 @@ for tree={,draw, s sep+=0.25em}
 }
 
 // GetAllStars returns all the stars in the tree it is called on in an array
-func (n Node) GetAllStars() []string {
+func (n Node) GetAllStars() []Star2D {
 
 	// define a list to store the stars
-	listOfNodes := []string{}
+	listOfNodes := []Star2D{}
 
 	// if there is a star in the node, append the star to the list
 	if n.Star != (Star2D{}) {
-		starJson, err := json.Marshal(n.Star)
-		if err != nil {
-			panic(err)
-		}
-
-		listOfNodes = append(listOfNodes, string(starJson))
+		listOfNodes = append(listOfNodes, n.Star)
 	}
 
 	// iterate over all the subtrees