Codechange: cleanup CargoPacket in terms of variable/function names (#11278)

Over the years, things got reused and changed, making the current
names somewhat unclear in what they actually mean and do.
This commit is contained in:
Patric Stout
2023-09-09 23:21:21 +02:00
committed by GitHub
parent b0e73277d6
commit 30172fc037
14 changed files with 106 additions and 99 deletions

View File

@@ -69,7 +69,7 @@ template<bool Tfrom, bool Tvia>
StationCargoList::ConstIterator(cargo_list.Packets()->end()));
for (StationCargoList::ConstIterator it = range.first; it != range.second; it++) {
const CargoPacket *cp = *it;
if (!Tfrom || cp->SourceStation() == from_station_id) cargo_count += cp->Count();
if (!Tfrom || cp->GetFirstStation() == from_station_id) cargo_count += cp->Count();
}
return cargo_count;

View File

@@ -179,7 +179,7 @@ void ScriptStationList_CargoWaiting::Add(StationID station_id, CargoID cargo, St
StationCargoList::ConstIterator iter = collector.GE()->cargo.Packets()->begin();
StationCargoList::ConstIterator end = collector.GE()->cargo.Packets()->end();
for (; iter != end; ++iter) {
collector.Update<Tselector>((*iter)->SourceStation(), iter.GetKey(), (*iter)->Count());
collector.Update<Tselector>((*iter)->GetFirstStation(), iter.GetKey(), (*iter)->Count());
}
}
@@ -218,7 +218,7 @@ ScriptStationList_CargoWaitingViaByFrom::ScriptStationList_CargoWaitingViaByFrom
std::pair<StationCargoList::ConstIterator, StationCargoList::ConstIterator> range =
collector.GE()->cargo.Packets()->equal_range(via);
for (StationCargoList::ConstIterator iter = range.first; iter != range.second; ++iter) {
collector.Update<CS_VIA_BY_FROM>((*iter)->SourceStation(), iter.GetKey(), (*iter)->Count());
collector.Update<CS_VIA_BY_FROM>((*iter)->GetFirstStation(), iter.GetKey(), (*iter)->Count());
}
}