Codechange: Make SpriteType, CargoSortType, SourceType and ScriptType enum classes. (#10663)

This avoids a (soft) namespace conflict between the four ST_* enums.
This commit is contained in:
PeterN
2023-04-16 20:00:55 +01:00
committed by GitHub
parent 32c8e7feb8
commit e97bf271dc
42 changed files with 189 additions and 189 deletions

View File

@@ -124,13 +124,13 @@ void AddCargoDelivery(CargoID cargo_type, CompanyID company, uint32 amount, Sour
if (src != INVALID_SOURCE) {
/* Handle pickup update. */
switch (src_type) {
case ST_INDUSTRY: {
case SourceType::Industry: {
CargoMonitorID num = EncodeCargoIndustryMonitor(company, cargo_type, src);
CargoMonitorMap::iterator iter = _cargo_pickups.find(num);
if (iter != _cargo_pickups.end()) iter->second += amount;
break;
}
case ST_TOWN: {
case SourceType::Town: {
CargoMonitorID num = EncodeCargoTownMonitor(company, cargo_type, src);
CargoMonitorMap::iterator iter = _cargo_pickups.find(num);
if (iter != _cargo_pickups.end()) iter->second += amount;