Partially working draft

This commit is contained in:
2022-09-14 21:21:39 +08:00
parent afb73b70ff
commit 534bc70f0f
6 changed files with 151 additions and 40 deletions

View File

@@ -0,0 +1,27 @@
package bus
type BusStop struct {
RouteId string
Direction string
StationSeq int
StationId string
Latitude float64
Longtitude float64
Name *map[string] string
RouteStops *map[int] *BusStop
}
func ( busStop BusStop ) PrevStop() *BusStop {
if v, hasKey := (*busStop.RouteStops)[ busStop.StationSeq - 1 ]; hasKey {
return v
}
return nil
}
func ( busStop BusStop ) NextStop() *BusStop {
if v, hasKey := (*busStop.RouteStops)[ busStop.StationSeq + 1 ]; hasKey {
return v
}
return nil
}