MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / BuildFlowList

Method BuildFlowList

src/station_gui.cpp:1583–1598  ·  view source on GitHub ↗

* Build up the cargo view for PLANNED mode and a specific cargo. * @param cargo Cargo to show. * @param flows The current station's flows for that cargo. * @param entry The CargoDataEntry to save the results in. */

Source from the content-addressed store, hash-verified

1581 * @param entry The CargoDataEntry to save the results in.
1582 */
1583 void BuildFlowList(CargoType cargo, const FlowStatMap &flows, CargoDataEntry *entry)
1584 {
1585 const CargoDataEntry *source_dest = this->cached_destinations.Retrieve(cargo);
1586 for (FlowStatMap::const_iterator it = flows.begin(); it != flows.end(); ++it) {
1587 StationID from = it->first;
1588 const CargoDataEntry *source_entry = source_dest->Retrieve(from);
1589 const FlowStat::SharesMap *shares = it->second.GetShares();
1590 for (FlowStat::SharesMap::const_iterator flow_it = shares->begin(); flow_it != shares->end(); ++flow_it) {
1591 const CargoDataEntry *via_entry = source_entry->Retrieve(flow_it->second);
1592 for (CargoDataSet::iterator dest_it = via_entry->Begin(); dest_it != via_entry->End(); ++dest_it) {
1593 CargoDataEntry &dest_entry = **dest_it;
1594 ShowCargo(entry, cargo, from, flow_it->second, dest_entry.GetStation(), dest_entry.GetCount());
1595 }
1596 }
1597 }
1598 }
1599
1600 /**
1601 * Build up the cargo view for WAITING mode and a specific cargo.

Callers 1

BuildCargoListMethod · 0.95

Calls 8

GetSharesMethod · 0.80
GetStationMethod · 0.80
RetrieveMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
BeginMethod · 0.45
EndMethod · 0.45
GetCountMethod · 0.45

Tested by

no test coverage detected