From d3a62fe249c8c038b84f333f16958ae14bee0450 Mon Sep 17 00:00:00 2001 From: David Stark Date: Thu, 5 Dec 2019 15:22:02 +0000 Subject: [PATCH] getting there.. (sorting the data).. need to parse the links now --- data/main.go | 63 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/data/main.go b/data/main.go index aafc6f8..dbf4de3 100644 --- a/data/main.go +++ b/data/main.go @@ -98,33 +98,54 @@ func main() { jsonObjSystems := gabs.New() for _, data := range OrigKspace.Maps { - Region := data.MapName - if Region == "Delve" { - // fmt.Printf("######################## \n#### %v\n", Region) + // Region := data.MapName + FauxRegion := data.MapName + // if FauxRegion == "Delve" { - for _, system := range data.Systems { - SystemName := system.Sn - SystemID := system.Sid - // SystemSec := system.Sec - // fmt.Println(SystemName) + // fmt.Printf("######################## \n#### %v\n", Region) - fmt.Printf("[%v]: (%v) %v -> ", Region, SystemID, SystemName) - for _, link := range system.Links { - s := strconv.FormatInt(link, 10) - fmt.Printf(" %v", s) + for _, system := range data.Systems { + + // TODO: learning.. this chained if sucks.. find correct pattern and learn/use it + + // filter only for systems in the regional area of the data/map + Region := system.Rn + if Region == FauxRegion { + // exclude the Jove system + if Region != "J7HZ-F" { + // excude this.. no connections whatever it is + if Region != "A821-A" { + // and this.. whatever it is + if Region != "UUA-F4" { + + SystemName := system.Sn + SystemID := system.Sid + Constellation := system.Cn + // SystemSec := system.Sec + // fmt.Println(SystemName) + + fmt.Printf("[%v/%v]: (%v) %v -> ", Region, Constellation, SystemID, SystemName) + for _, link := range system.Links { + s := strconv.FormatInt(link, 10) + fmt.Printf(" %v", s) + } + fmt.Printf("\n") + // jsonObjSystems.Set(SystemID, "systems", SystemName, "id") + // jsonObjSystems.Set(SystemSec, "systems", SystemName, "sec") + + } + } } - fmt.Printf("\n") - // jsonObjSystems.Set(SystemID, "systems", SystemName, "id") - // jsonObjSystems.Set(SystemSec, "systems", SystemName, "sec") } - - // for _, gate := range data.Gates { - // fmt.Printf("T: %v\n", gate.T) - // fmt.Printf("S: %v\n", gate.S) - // } - } + // for _, gate := range data.Gates { + // fmt.Printf("T: %v\n", gate.T) + // fmt.Printf("S: %v\n", gate.S) + // } + + // } + } for _, data := range OrigKspace.Maps {