getting there.. (sorting the data).. need to parse the links now
This commit is contained in:
+42
-21
@@ -98,33 +98,54 @@ 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
|
||||||
// fmt.Printf("######################## \n#### %v\n", Region)
|
// if FauxRegion == "Delve" {
|
||||||
|
|
||||||
for _, system := range data.Systems {
|
// fmt.Printf("######################## \n#### %v\n", Region)
|
||||||
SystemName := system.Sn
|
|
||||||
SystemID := system.Sid
|
|
||||||
// SystemSec := system.Sec
|
|
||||||
// fmt.Println(SystemName)
|
|
||||||
|
|
||||||
fmt.Printf("[%v]: (%v) %v -> ", Region, SystemID, SystemName)
|
for _, system := range data.Systems {
|
||||||
for _, link := range system.Links {
|
|
||||||
s := strconv.FormatInt(link, 10)
|
// TODO: learning.. this chained if sucks.. find correct pattern and learn/use it
|
||||||
fmt.Printf(" %v", s)
|
|
||||||
|
// 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 {
|
for _, data := range OrigKspace.Maps {
|
||||||
|
|||||||
Reference in New Issue
Block a user