Partially working draft
This commit is contained in:
27
datasources/mtr/bus/BusStop.go
Normal file
27
datasources/mtr/bus/BusStop.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user