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

Method ConvertState

src/newgrf_station.cpp:60–68  ·  view source on GitHub ↗

* Convert GoodsEntry status to the form required for NewGRF variables. * @return NewGRF representation of GoodsEntry state. */

Source from the content-addressed store, hash-verified

58 * @return NewGRF representation of GoodsEntry state.
59 */
60uint8_t GoodsEntry::ConvertState() const
61{
62 uint8_t res = 0;
63 if (this->status.Test(GoodsEntry::State::EverAccepted)) SetBit(res, 0);
64 if (this->status.Test(GoodsEntry::State::LastMonth)) SetBit(res, 1);
65 if (this->status.Test(GoodsEntry::State::CurrentMonth)) SetBit(res, 2);
66 if (this->status.Test(GoodsEntry::State::AcceptedBigtick)) SetBit(res, 3);
67 return res;
68}
69
70enum TriggerArea : uint8_t {
71 TA_TILE,

Callers 2

GetNewGRFVariableMethod · 0.80
GetVariableMethod · 0.80

Calls 2

SetBitFunction · 0.85
TestMethod · 0.80

Tested by

no test coverage detected