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
+42 -21
View File
@@ -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 {