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

Function GetAcceptanceMask

src/station_cmd.cpp:489–497  ·  view source on GitHub ↗

* Get a mask of the cargo types that the station accepts. * @param st Station to query * @return the expected mask */

Source from the content-addressed store, hash-verified

487 * @return the expected mask
488 */
489CargoTypes GetAcceptanceMask(const Station *st)
490{
491 CargoTypes mask = 0;
492
493 for (auto it = std::begin(st->goods); it != std::end(st->goods); ++it) {
494 if (it->status.Test(GoodsEntry::State::Acceptance)) SetBit(mask, std::distance(std::begin(st->goods), it));
495 }
496 return mask;
497}
498
499/**
500 * Get a mask of the cargo types that are empty at the station.

Callers 3

GetNewGRFVariableMethod · 0.85
UpdateStationAcceptanceFunction · 0.85
DrawAcceptedCargoMethod · 0.85

Calls 4

SetBitFunction · 0.85
TestMethod · 0.80
beginFunction · 0.50
endFunction · 0.50

Tested by

no test coverage detected