* Refresh all links the given vehicle will visit. * @param v Vehicle to refresh links for. * @param allow_merge If the refresher is allowed to merge or extend link graphs. * @param is_full_loading If the vehicle is full loading. */ static */
| 24 | * @param is_full_loading If the vehicle is full loading. |
| 25 | */ |
| 26 | /* static */ void LinkRefresher::Run(Vehicle *v, bool allow_merge, bool is_full_loading) |
| 27 | { |
| 28 | /* If there are no orders we can't predict anything.*/ |
| 29 | if (v->orders == nullptr) return; |
| 30 | |
| 31 | /* Make sure the first order is a useful order. */ |
| 32 | VehicleOrderID first = v->orders->GetNextDecisionNode(v->cur_implicit_order_index, 0); |
| 33 | if (first == INVALID_VEH_ORDER_ID) return; |
| 34 | |
| 35 | HopSet seen_hops; |
| 36 | LinkRefresher refresher(v, &seen_hops, allow_merge, is_full_loading); |
| 37 | |
| 38 | refresher.RefreshLinks(first, first, v->last_loading_station != StationID::Invalid() ? RefreshFlags{RefreshFlag::HasCargo} : RefreshFlags{}); |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Constructor for link refreshing algorithm. |
nothing calls this directly
no test coverage detected