* 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. */
| 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. |
no test coverage detected