static */
| 96 | |
| 97 | template <bool Tfrom, bool Tvia> |
| 98 | /* static */ SQInteger ScriptStation::CountCargoPlanned(StationID station_id, |
| 99 | StationID from_station_id, StationID via_station_id, CargoType cargo_type) |
| 100 | { |
| 101 | if (!ScriptStation::IsCargoRequestValid<Tfrom, Tvia>(station_id, from_station_id, |
| 102 | via_station_id, cargo_type)) { |
| 103 | return -1; |
| 104 | } |
| 105 | |
| 106 | const ::GoodsEntry &goods = ::Station::Get(station_id)->goods[cargo_type]; |
| 107 | if (!goods.HasData()) return 0; |
| 108 | |
| 109 | const FlowStatMap &flows = goods.GetData().flows; |
| 110 | if (Tfrom) { |
| 111 | return Tvia ? flows.GetFlowFromVia(from_station_id, via_station_id) : |
| 112 | flows.GetFlowFrom(from_station_id); |
| 113 | } else { |
| 114 | return Tvia ? flows.GetFlowVia(via_station_id) : flows.GetFlow(); |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | /* static */ SQInteger ScriptStation::GetCargoPlanned(StationID station_id, CargoType cargo_type) |
| 119 | { |
nothing calls this directly
no test coverage detected