* Get the value of the given user-changeable parameter. * @param info The grf parameter info to get the value for. * @return The value of this parameter. */
| 162 | * @return The value of this parameter. |
| 163 | */ |
| 164 | uint32_t GRFConfig::GetValue(const GRFParameterInfo &info) const |
| 165 | { |
| 166 | /* If the parameter is not set then it must be 0. */ |
| 167 | if (info.param_nr >= std::size(this->param)) return 0; |
| 168 | |
| 169 | /* GB doesn't work correctly with nbits == 32, so handle that case here. */ |
| 170 | if (info.num_bit == 32) return this->param[info.param_nr]; |
| 171 | |
| 172 | return GB(this->param[info.param_nr], info.first_bit, info.num_bit); |
| 173 | } |
| 174 | |
| 175 | /** |
| 176 | * Set the value of the given user-changeable parameter. |
no test coverage detected