Skip to content

Instantly share code, notes, and snippets.

@mkock
Created August 20, 2020 19:27
Show Gist options
  • Select an option

  • Save mkock/d329b17ed1c63ae4c44b9dac3caededa to your computer and use it in GitHub Desktop.

Select an option

Save mkock/d329b17ed1c63ae4c44b9dac3caededa to your computer and use it in GitHub Desktop.
Bus Ride, code snippet 27
// NotifyBusArrival is called by Bus upon arrival.
func (b *BusStop) NotifyBusArrival(bus *Bus) {
for _, p := range b.prospects {
if bus.StopsAt(p.Destination) {
pas := p.ToPassenger()
bus.Board(pas, bus.Company.GetPricing()(pas))
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment