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

Method Add

src/script/api/script_stationlist.cpp:178–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176
177template <ScriptStationList_Cargo::CargoSelector Tselector>
178void ScriptStationList_CargoWaiting::Add(StationID station_id, CargoType cargo, StationID other_station)
179{
180 CargoCollector collector(this, station_id, cargo, other_station);
181 if (collector.GE() == nullptr) return;
182 if (!collector.GE()->HasData()) return;
183
184 StationCargoList::ConstIterator iter = collector.GE()->GetData().cargo.Packets()->begin();
185 StationCargoList::ConstIterator end = collector.GE()->GetData().cargo.Packets()->end();
186 for (; iter != end; ++iter) {
187 collector.Update<Tselector>((*iter)->GetFirstStation(), iter.GetKey(), (*iter)->Count());
188 }
189}
190
191
192template <ScriptStationList_Cargo::CargoSelector Tselector>

Callers

nothing calls this directly

Calls 8

GEMethod · 0.80
PacketsMethod · 0.80
GetSharesMethod · 0.80
HasDataMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
GetFirstStationMethod · 0.45
CountMethod · 0.45

Tested by

no test coverage detected