Codechange: Use std::array for industry tile cargo acceptance. (#11498)

This avoids use of memcpy/memset to copy or fill.
This commit is contained in:
Peter Nelson
2023-11-27 23:17:55 +00:00
committed by GitHub
parent f268c90bd3
commit e5aed24395
3 changed files with 14 additions and 16 deletions

View File

@@ -152,8 +152,8 @@ struct IndustrySpec {
* @note A tile can at most accept 3 types of cargo, even if an industry as a whole can accept more types.
*/
struct IndustryTileSpec {
CargoID accepts_cargo[INDUSTRY_NUM_INPUTS]; ///< Cargo accepted by this tile
int8_t acceptance[INDUSTRY_NUM_INPUTS]; ///< Level of acceptance per cargo type (signed, may be negative!)
std::array<CargoID, INDUSTRY_NUM_INPUTS> accepts_cargo; ///< Cargo accepted by this tile
std::array<int8_t, INDUSTRY_NUM_INPUTS> acceptance; ///< Level of acceptance per cargo type (signed, may be negative!)
Slope slopes_refused; ///< slope pattern on which this tile cannot be built
byte anim_production; ///< Animation frame to start when goods are produced
byte anim_next; ///< Next frame in an animation