Created
August 20, 2020 19:27
-
-
Save mkock/d329b17ed1c63ae4c44b9dac3caededa to your computer and use it in GitHub Desktop.
Bus Ride, code snippet 27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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