getting there.. (sorting the data).. need to parse the links now

This commit is contained in:
2019-12-05 15:22:02 +00:00
parent 029df054c1
commit d3a62fe249
+25 -4
View File
@@ -98,17 +98,33 @@ func main() {
jsonObjSystems := gabs.New() jsonObjSystems := gabs.New()
for _, data := range OrigKspace.Maps { for _, data := range OrigKspace.Maps {
Region := data.MapName // Region := data.MapName
if Region == "Delve" { FauxRegion := data.MapName
// if FauxRegion == "Delve" {
// fmt.Printf("######################## \n#### %v\n", Region) // fmt.Printf("######################## \n#### %v\n", Region)
for _, system := range data.Systems { 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 SystemName := system.Sn
SystemID := system.Sid SystemID := system.Sid
Constellation := system.Cn
// SystemSec := system.Sec // SystemSec := system.Sec
// fmt.Println(SystemName) // fmt.Println(SystemName)
fmt.Printf("[%v]: (%v) %v -> ", Region, SystemID, SystemName) fmt.Printf("[%v/%v]: (%v) %v -> ", Region, Constellation, SystemID, SystemName)
for _, link := range system.Links { for _, link := range system.Links {
s := strconv.FormatInt(link, 10) s := strconv.FormatInt(link, 10)
fmt.Printf(" %v", s) fmt.Printf(" %v", s)
@@ -116,6 +132,11 @@ func main() {
fmt.Printf("\n") fmt.Printf("\n")
// jsonObjSystems.Set(SystemID, "systems", SystemName, "id") // jsonObjSystems.Set(SystemID, "systems", SystemName, "id")
// jsonObjSystems.Set(SystemSec, "systems", SystemName, "sec") // jsonObjSystems.Set(SystemSec, "systems", SystemName, "sec")
}
}
}
}
} }
// for _, gate := range data.Gates { // for _, gate := range data.Gates {
@@ -123,7 +144,7 @@ func main() {
// fmt.Printf("S: %v\n", gate.S) // fmt.Printf("S: %v\n", gate.S)
// } // }
} // }
} }