MCPcopy Create free account
hub / github.com/akeranen/the-one / busHasStopped

Method busHasStopped

movement/BusControlSystem.java:60–76  ·  view source on GitHub ↗

Called by busses belonging to this system every time the bus has stopped. It calls every passengers enterBus() method so that the passengers can enter the bus if they want to. @param busID Unique identifier of the bus @param busStop Coordinates of the bus stop @param nextPath The path to the next st

(int busID, Coord busStop, Path nextPath)

Source from the content-addressed store, hash-verified

58 * @param nextPath The path to the next stop
59 */
60 public void busHasStopped(int busID, Coord busStop, Path nextPath) {
61 Iterator<BusTravellerMovement> iterator = travellers.values().
62 iterator();
63 while (iterator.hasNext()) {
64 BusTravellerMovement traveller = (BusTravellerMovement)iterator.
65 next();
66 if (traveller.getLocation() != null) {
67 if ((traveller.getLocation()).equals(busStop)) {
68 if (traveller.getState() == BusTravellerMovement.
69 STATE_WAITING_FOR_BUS) {
70 Path path = new Path(nextPath);
71 traveller.enterBus(path);
72 }
73 }
74 }
75 }
76 }
77
78 /**
79 * Returns a reference to a BusControlSystem with ID provided as parameter.

Callers 1

getPathMethod · 0.80

Calls 6

getLocationMethod · 0.95
getStateMethod · 0.95
enterBusMethod · 0.95
hasNextMethod · 0.80
nextMethod · 0.80
equalsMethod · 0.45

Tested by

no test coverage detected