Codechange: Rename and move SpriteGroup-specific cargo types into a namespace.

These 'cargo types' have special defined uses and must not be used elsewhere. This makes it clearer that they are special.
This commit is contained in:
Peter Nelson
2024-01-08 21:40:09 +00:00
committed by Peter Nelson
parent 400ae65ff2
commit 97e2bc612c
5 changed files with 30 additions and 23 deletions

View File

@@ -14,9 +14,16 @@
#include "cargo_type.h"
#include "gfx_type.h"
static const CargoID CT_DEFAULT = NUM_CARGO + 0;
static const CargoID CT_PURCHASE = NUM_CARGO + 1;
static const CargoID CT_DEFAULT_NA = NUM_CARGO + 2;
/**
* Sprite Group Cargo types.
* These special cargo types are used when resolving sprite groups when non-cargo-specific sprites or callbacks are needed,
* e.g. in purchase lists, or if no specific cargo type sprite group is supplied.
*/
namespace SpriteGroupCargo {
static constexpr CargoID SG_DEFAULT = NUM_CARGO; ///< Default type used when no more-specific cargo matches.
static constexpr CargoID SG_PURCHASE = NUM_CARGO + 1; ///< Used in purchase lists before an item exists.
static constexpr CargoID SG_DEFAULT_NA = NUM_CARGO + 2; ///< Used only by stations and roads when no more-specific cargo matches.
};
/* Forward declarations of structs used */
struct CargoSpec;