diff options
author | fonsinchen <fonsinchen@openttd.org> | 2013-06-09 12:49:47 +0000 |
---|---|---|
committer | fonsinchen <fonsinchen@openttd.org> | 2013-06-09 12:49:47 +0000 |
commit | db671ffb8673c5088749663e64713d9b852ec1e5 (patch) | |
tree | 132d0af53b5101417f0ddd01feedc703d8d614a9 /src/station_cmd.cpp | |
parent | c8f068d979251fb6963a56e3c0f9dac5b9897c72 (diff) | |
download | openttd-db671ffb8673c5088749663e64713d9b852ec1e5.tar.xz |
(svn r25346) -Codechange: Glue between stations and flow stats
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r-- | src/station_cmd.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 1dad5d292..7fdef90de 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -4161,6 +4161,20 @@ void FlowStatMap::DeleteFlows(StationID via) } } +/** + * Get the sum of flows via a specific station from this GoodsEntry. + * @param via Remote station to look for. + * @return a FlowStat with all flows for 'via' added up. + */ +uint GoodsEntry::GetSumFlowVia(StationID via) const +{ + uint ret = 0; + for (FlowStatMap::const_iterator i = this->flows.begin(); i != this->flows.end(); ++i) { + ret += i->second.GetShare(via); + } + return ret; +} + extern const TileTypeProcs _tile_type_station_procs = { DrawTile_Station, // draw_tile_proc GetSlopePixelZ_Station, // get_slope_z_proc |