diff --git a/src/cargotype.cpp b/src/cargotype.cpp index 99f1d49593..4fff75b7d5 100644 --- a/src/cargotype.cpp +++ b/src/cargotype.cpp @@ -61,9 +61,9 @@ static std::array _climate_independent_cargo_labels; * Set up the default cargo types for the given landscape type. * @param l Landscape */ -void SetupCargoForClimate(LandscapeID l) +void SetupCargoForClimate(LandscapeType l) { - assert(l < lengthof(_default_climate_cargo)); + assert(to_underlying(l) < std::size(_default_climate_cargo)); _cargo_mask = 0; _default_cargo_labels.clear(); @@ -72,7 +72,7 @@ void SetupCargoForClimate(LandscapeID l) /* Copy from default cargo by label or index. */ auto insert = std::begin(CargoSpec::array); - for (const auto &cl : _default_climate_cargo[l]) { + for (const auto &cl : _default_climate_cargo[to_underlying(l)]) { struct visitor { const CargoSpec &operator()(const int &index) diff --git a/src/cargotype.h b/src/cargotype.h index a7732c77f9..b2b6f70190 100644 --- a/src/cargotype.h +++ b/src/cargotype.h @@ -202,7 +202,7 @@ private: static CargoSpec array[NUM_CARGO]; ///< Array holding all CargoSpecs static inline std::map label_map{}; ///< Translation map from CargoLabel to Cargo type. - friend void SetupCargoForClimate(LandscapeID l); + friend void SetupCargoForClimate(LandscapeType l); friend void BuildCargoLabelMap(); friend inline CargoType GetCargoTypeByLabel(CargoLabel ct); friend void FinaliseCargoArray(); @@ -211,7 +211,7 @@ private: extern CargoTypes _cargo_mask; extern CargoTypes _standard_cargo_mask; -void SetupCargoForClimate(LandscapeID l); +void SetupCargoForClimate(LandscapeType l); bool IsDefaultCargo(CargoType cargo_type); void BuildCargoLabelMap(); diff --git a/src/clear_cmd.cpp b/src/clear_cmd.cpp index c40904e0fd..ee4b9f6d27 100644 --- a/src/clear_cmd.cpp +++ b/src/clear_cmd.cpp @@ -231,8 +231,9 @@ static void TileLoop_Clear(TileIndex tile) AmbientSoundEffect(tile); switch (_settings_game.game_creation.landscape) { - case LT_TROPIC: TileLoopClearDesert(tile); break; - case LT_ARCTIC: TileLoopClearAlps(tile); break; + case LandscapeType::Tropic: TileLoopClearDesert(tile); break; + case LandscapeType::Arctic: TileLoopClearAlps(tile); break; + default: break; } switch (GetClearGround(tile)) { diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 594869d288..b347ff0f30 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -1807,7 +1807,7 @@ struct CompanyInfrastructureWindow : Window /* Find the used railtypes. */ for (const Engine *e : Engine::IterateType(VEH_TRAIN)) { - if (!HasBit(e->info.climates, _settings_game.game_creation.landscape)) continue; + if (!e->info.climates.Test(_settings_game.game_creation.landscape)) continue; this->railtypes |= GetRailTypeInfo(e->u.rail.railtype)->introduces_railtypes; } @@ -1817,7 +1817,7 @@ struct CompanyInfrastructureWindow : Window /* Find the used roadtypes. */ for (const Engine *e : Engine::IterateType(VEH_ROAD)) { - if (!HasBit(e->info.climates, _settings_game.game_creation.landscape)) continue; + if (!e->info.climates.Test(_settings_game.game_creation.landscape)) continue; this->roadtypes |= GetRoadTypeInfo(e->u.road.roadtype)->introduces_roadtypes; } diff --git a/src/engine.cpp b/src/engine.cpp index dbc68b73d7..7d949b4304 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -146,7 +146,7 @@ Engine::Engine(VehicleType type, uint16_t local_id) */ bool Engine::IsEnabled() const { - return this->info.string_id != STR_NEWGRF_INVALID_ENGINE && HasBit(this->info.climates, _settings_game.game_creation.landscape); + return this->info.string_id != STR_NEWGRF_INVALID_ENGINE && this->info.climates.Test(_settings_game.game_creation.landscape); } /** @@ -699,7 +699,7 @@ void SetYearEngineAgingStops() const EngineInfo *ei = &e->info; /* Exclude certain engines */ - if (!HasBit(ei->climates, _settings_game.game_creation.landscape)) continue; + if (!ei->climates.Test(_settings_game.game_creation.landscape)) continue; if (e->type == VEH_TRAIN && e->u.rail.railveh_type == RAILVEH_WAGON) continue; /* Base year ending date on half the model life */ @@ -786,7 +786,7 @@ void StartupOneEngine(Engine *e, const TimerGameCalendar::YearMonthDay &aging_ym e->reliability_spd_dec = ei->decay_speed << 2; /* prevent certain engines from ever appearing. */ - if (!HasBit(ei->climates, _settings_game.game_creation.landscape)) { + if (!ei->climates.Test(_settings_game.game_creation.landscape)) { e->flags.Set(EngineFlag::Available); e->company_avail = 0; } diff --git a/src/engine_type.h b/src/engine_type.h index 4e5b00161f..022d673e6b 100644 --- a/src/engine_type.h +++ b/src/engine_type.h @@ -11,6 +11,7 @@ #define ENGINE_TYPE_H #include "economy_type.h" +#include "landscape_type.h" #include "newgrf_callbacks.h" #include "rail_type.h" #include "road_type.h" @@ -170,7 +171,7 @@ struct EngineInfo { TimerGameCalendar::Year base_life; ///< Basic duration of engine availability (without random parts). \c 0xFF means infinite life. uint8_t decay_speed; uint8_t load_amount; - uint8_t climates; ///< Climates supported by the engine. + LandscapeTypes climates; ///< Climates supported by the engine. CargoType cargo_type; std::variant cargo_label; CargoTypes refit_mask; diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp index 8903b2d053..cc89c0cb9d 100644 --- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -558,9 +558,9 @@ public: if (tr.top > tr.bottom) return; /* Climate */ - uint8_t landscape = _load_check_data.settings.game_creation.landscape; - if (landscape < NUM_LANDSCAPE) { - SetDParam(0, STR_CLIMATE_TEMPERATE_LANDSCAPE + landscape); + LandscapeType landscape = _load_check_data.settings.game_creation.landscape; + if (to_underlying(landscape) < NUM_LANDSCAPE) { + SetDParam(0, STR_CLIMATE_TEMPERATE_LANDSCAPE + to_underlying(landscape)); DrawString(tr, STR_NETWORK_SERVER_LIST_LANDSCAPE); tr.top += GetCharacterHeight(FS_NORMAL); } diff --git a/src/gamelog_internal.h b/src/gamelog_internal.h index f0cbf18228..0bf467ecdc 100644 --- a/src/gamelog_internal.h +++ b/src/gamelog_internal.h @@ -11,6 +11,7 @@ #define GAMELOG_INTERNAL_H #include "gamelog.h" +#include "landscape_type.h" /** * Information about the presence of a Grf at a certain point during gamelog history @@ -38,12 +39,12 @@ struct LoggedChange { struct LoggedChangeMode : LoggedChange { LoggedChangeMode() : LoggedChange(GLCT_MODE) {} - LoggedChangeMode(uint8_t mode, uint8_t landscape) : + LoggedChangeMode(uint8_t mode, LandscapeType landscape) : LoggedChange(GLCT_MODE), mode(mode), landscape(landscape) {} void FormatTo(std::back_insert_iterator &output_iterator, GrfIDMapping &grf_names, GamelogActionType action_type) override; uint8_t mode; ///< new game mode - Editor x Game - uint8_t landscape; ///< landscape (temperate, arctic, ...) + LandscapeType landscape; ///< landscape (temperate, arctic, ...) }; struct LoggedChangeRevision : LoggedChange { diff --git a/src/genworld.h b/src/genworld.h index 4c90930f81..d7de534998 100644 --- a/src/genworld.h +++ b/src/genworld.h @@ -11,6 +11,7 @@ #define GENWORLD_H #include "company_type.h" +#include "landscape_type.h" #include /** Constants related to world generation */ @@ -92,7 +93,7 @@ void HandleGeneratingWorldAbortion(); void LoadTownData(); /* genworld_gui.cpp */ -void SetNewLandscapeType(uint8_t landscape); +void SetNewLandscapeType(LandscapeType landscape); void SetGeneratingWorldProgress(GenWorldProgress cls, uint total); void IncreaseGeneratingWorldProgress(GenWorldProgress cls); void PrepareGenerateWorldProgress(); diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index dbbb3af404..41a6ea1890 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -62,7 +62,7 @@ static uint GetMapHeightLimit() * Changes landscape type and sets genworld window dirty * @param landscape new landscape type */ -void SetNewLandscapeType(uint8_t landscape) +void SetNewLandscapeType(LandscapeType landscape) { _settings_newgame.game_creation.landscape = landscape; InvalidateWindowClassesData(WC_SELECT_GAME); @@ -395,7 +395,7 @@ struct GenerateLandscapeWindow : public Window { { this->InitNested(number); - this->LowerWidget(_settings_newgame.game_creation.landscape + WID_GL_TEMPERATE); + this->LowerWidget(to_underlying(_settings_newgame.game_creation.landscape) + WID_GL_TEMPERATE); this->mode = (GenerateLandscapeWindowMode)this->window_number; @@ -507,10 +507,10 @@ struct GenerateLandscapeWindow : public Window { { if (!gui_scope) return; /* Update the climate buttons */ - this->SetWidgetLoweredState(WID_GL_TEMPERATE, _settings_newgame.game_creation.landscape == LT_TEMPERATE); - this->SetWidgetLoweredState(WID_GL_ARCTIC, _settings_newgame.game_creation.landscape == LT_ARCTIC); - this->SetWidgetLoweredState(WID_GL_TROPICAL, _settings_newgame.game_creation.landscape == LT_TROPIC); - this->SetWidgetLoweredState(WID_GL_TOYLAND, _settings_newgame.game_creation.landscape == LT_TOYLAND); + this->SetWidgetLoweredState(WID_GL_TEMPERATE, _settings_newgame.game_creation.landscape == LandscapeType::Temperate); + this->SetWidgetLoweredState(WID_GL_ARCTIC, _settings_newgame.game_creation.landscape == LandscapeType::Arctic); + this->SetWidgetLoweredState(WID_GL_TROPICAL, _settings_newgame.game_creation.landscape == LandscapeType::Tropic); + this->SetWidgetLoweredState(WID_GL_TOYLAND, _settings_newgame.game_creation.landscape == LandscapeType::Toyland); /* You can't select smoothness / non-water borders if not terragenesis */ if (mode == GLWM_GENERATE) { @@ -527,22 +527,22 @@ struct GenerateLandscapeWindow : public Window { this->SetWidgetLoweredState(WID_GL_WATER_SE, _settings_newgame.game_creation.water_borders.Test(BorderFlag::SouthEast)); this->SetWidgetLoweredState(WID_GL_WATER_SW, _settings_newgame.game_creation.water_borders.Test(BorderFlag::SouthWest)); - this->SetWidgetsDisabledState(_settings_newgame.game_creation.land_generator == LG_ORIGINAL && (_settings_newgame.game_creation.landscape == LT_ARCTIC || _settings_newgame.game_creation.landscape == LT_TROPIC), + this->SetWidgetsDisabledState(_settings_newgame.game_creation.land_generator == LG_ORIGINAL && (_settings_newgame.game_creation.landscape == LandscapeType::Arctic || _settings_newgame.game_creation.landscape == LandscapeType::Tropic), WID_GL_TERRAIN_PULLDOWN, WID_GL_WATER_PULLDOWN); } /* Disable snowline if not arctic */ - this->SetWidgetDisabledState(WID_GL_SNOW_COVERAGE_TEXT, _settings_newgame.game_creation.landscape != LT_ARCTIC); + this->SetWidgetDisabledState(WID_GL_SNOW_COVERAGE_TEXT, _settings_newgame.game_creation.landscape != LandscapeType::Arctic); /* Disable desert if not tropic */ - this->SetWidgetDisabledState(WID_GL_DESERT_COVERAGE_TEXT, _settings_newgame.game_creation.landscape != LT_TROPIC); + this->SetWidgetDisabledState(WID_GL_DESERT_COVERAGE_TEXT, _settings_newgame.game_creation.landscape != LandscapeType::Tropic); /* Set snow/rainforest selections */ int climate_plane = 0; switch (_settings_newgame.game_creation.landscape) { - case LT_TEMPERATE: climate_plane = 2; break; - case LT_ARCTIC: climate_plane = 0; break; - case LT_TROPIC: climate_plane = 1; break; - case LT_TOYLAND: climate_plane = 2; break; + case LandscapeType::Temperate: climate_plane = 2; break; + case LandscapeType::Arctic: climate_plane = 0; break; + case LandscapeType::Tropic: climate_plane = 1; break; + case LandscapeType::Toyland: climate_plane = 2; break; } this->GetWidget(WID_GL_CLIMATE_SEL_LABEL)->SetDisplayedPlane(climate_plane); this->GetWidget(WID_GL_CLIMATE_SEL_SELECTOR)->SetDisplayedPlane(climate_plane); @@ -554,10 +554,10 @@ struct GenerateLandscapeWindow : public Window { } this->SetWidgetDisabledState(WID_GL_START_DATE_DOWN, _settings_newgame.game_creation.starting_year <= CalendarTime::MIN_YEAR); this->SetWidgetDisabledState(WID_GL_START_DATE_UP, _settings_newgame.game_creation.starting_year >= CalendarTime::MAX_YEAR); - this->SetWidgetDisabledState(WID_GL_SNOW_COVERAGE_DOWN, _settings_newgame.game_creation.snow_coverage <= 0 || _settings_newgame.game_creation.landscape != LT_ARCTIC); - this->SetWidgetDisabledState(WID_GL_SNOW_COVERAGE_UP, _settings_newgame.game_creation.snow_coverage >= 100 || _settings_newgame.game_creation.landscape != LT_ARCTIC); - this->SetWidgetDisabledState(WID_GL_DESERT_COVERAGE_DOWN, _settings_newgame.game_creation.desert_coverage <= 0 || _settings_newgame.game_creation.landscape != LT_TROPIC); - this->SetWidgetDisabledState(WID_GL_DESERT_COVERAGE_UP, _settings_newgame.game_creation.desert_coverage >= 100 || _settings_newgame.game_creation.landscape != LT_TROPIC); + this->SetWidgetDisabledState(WID_GL_SNOW_COVERAGE_DOWN, _settings_newgame.game_creation.snow_coverage <= 0 || _settings_newgame.game_creation.landscape != LandscapeType::Arctic); + this->SetWidgetDisabledState(WID_GL_SNOW_COVERAGE_UP, _settings_newgame.game_creation.snow_coverage >= 100 || _settings_newgame.game_creation.landscape != LandscapeType::Arctic); + this->SetWidgetDisabledState(WID_GL_DESERT_COVERAGE_DOWN, _settings_newgame.game_creation.desert_coverage <= 0 || _settings_newgame.game_creation.landscape != LandscapeType::Tropic); + this->SetWidgetDisabledState(WID_GL_DESERT_COVERAGE_UP, _settings_newgame.game_creation.desert_coverage >= 100 || _settings_newgame.game_creation.landscape != LandscapeType::Tropic); /* Do not allow a custom sea level or terrain type with the original land generator. */ if (_settings_newgame.game_creation.land_generator == LG_ORIGINAL) { @@ -673,7 +673,7 @@ struct GenerateLandscapeWindow : public Window { case WID_GL_ARCTIC: case WID_GL_TROPICAL: case WID_GL_TOYLAND: - SetNewLandscapeType(widget - WID_GL_TEMPERATE); + SetNewLandscapeType(LandscapeType(widget - WID_GL_TEMPERATE)); break; case WID_GL_MAPSIZE_X_PULLDOWN: // Mapsize X @@ -1078,7 +1078,7 @@ struct CreateScenarioWindow : public Window CreateScenarioWindow(WindowDesc &desc, WindowNumber window_number) : Window(desc) { this->InitNested(window_number); - this->LowerWidget(_settings_newgame.game_creation.landscape + WID_CS_TEMPERATE); + this->LowerWidget(to_underlying(_settings_newgame.game_creation.landscape) + WID_CS_TEMPERATE); } void SetStringParameters(WidgetID widget) const override @@ -1109,10 +1109,10 @@ struct CreateScenarioWindow : public Window this->SetWidgetDisabledState(WID_CS_FLAT_LAND_HEIGHT_DOWN, _settings_newgame.game_creation.se_flat_world_height <= 0); this->SetWidgetDisabledState(WID_CS_FLAT_LAND_HEIGHT_UP, _settings_newgame.game_creation.se_flat_world_height >= GetMapHeightLimit()); - this->SetWidgetLoweredState(WID_CS_TEMPERATE, _settings_newgame.game_creation.landscape == LT_TEMPERATE); - this->SetWidgetLoweredState(WID_CS_ARCTIC, _settings_newgame.game_creation.landscape == LT_ARCTIC); - this->SetWidgetLoweredState(WID_CS_TROPICAL, _settings_newgame.game_creation.landscape == LT_TROPIC); - this->SetWidgetLoweredState(WID_CS_TOYLAND, _settings_newgame.game_creation.landscape == LT_TOYLAND); + this->SetWidgetLoweredState(WID_CS_TEMPERATE, _settings_newgame.game_creation.landscape == LandscapeType::Temperate); + this->SetWidgetLoweredState(WID_CS_ARCTIC, _settings_newgame.game_creation.landscape == LandscapeType::Arctic); + this->SetWidgetLoweredState(WID_CS_TROPICAL, _settings_newgame.game_creation.landscape == LandscapeType::Tropic); + this->SetWidgetLoweredState(WID_CS_TOYLAND, _settings_newgame.game_creation.landscape == LandscapeType::Toyland); this->DrawWidgets(); } @@ -1157,8 +1157,8 @@ struct CreateScenarioWindow : public Window case WID_CS_ARCTIC: case WID_CS_TROPICAL: case WID_CS_TOYLAND: - this->RaiseWidget(_settings_newgame.game_creation.landscape + WID_CS_TEMPERATE); - SetNewLandscapeType(widget - WID_CS_TEMPERATE); + this->RaiseWidget(to_underlying(_settings_newgame.game_creation.landscape) + WID_CS_TEMPERATE); + SetNewLandscapeType(LandscapeType(widget - WID_CS_TEMPERATE)); break; case WID_CS_MAPSIZE_X_PULLDOWN: // Mapsize X diff --git a/src/gfxinit.cpp b/src/gfxinit.cpp index ed5dcf7e78..1cdb3206e4 100644 --- a/src/gfxinit.cpp +++ b/src/gfxinit.cpp @@ -189,10 +189,10 @@ static void LoadSpriteTables() * This overwrites some of the temperate sprites, such as foundations * and the ground sprites. */ - if (_settings_game.game_creation.landscape != LT_TEMPERATE) { + if (_settings_game.game_creation.landscape != LandscapeType::Temperate) { LoadGrfFileIndexed( - used_set->files[GFT_ARCTIC + _settings_game.game_creation.landscape - 1].filename, - _landscape_spriteindexes[_settings_game.game_creation.landscape - 1], + used_set->files[GFT_ARCTIC + to_underlying(_settings_game.game_creation.landscape) - 1].filename, + _landscape_spriteindexes[to_underlying(_settings_game.game_creation.landscape) - 1], PAL_DOS != used_set->palette ); } diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 93bdf9eb4b..b46e6e160d 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -84,7 +84,7 @@ void ResetIndustries() /* Enable only the current climate industries */ for (auto it = std::begin(_industry_specs); it != industry_insert; ++it) { - it->enabled = HasBit(it->climate_availability, _settings_game.game_creation.landscape); + it->enabled = it->climate_availability.Test(_settings_game.game_creation.landscape); } auto industry_tile_insert = std::copy(std::begin(_origin_industry_tile_specs), std::end(_origin_industry_tile_specs), std::begin(_industry_tile_specs)); @@ -1039,13 +1039,13 @@ static void SetupFarmFieldFence(TileIndex tile, int size, uint8_t type, DiagDire static void PlantFarmField(TileIndex tile, IndustryID industry) { - if (_settings_game.game_creation.landscape == LT_ARCTIC) { + if (_settings_game.game_creation.landscape == LandscapeType::Arctic) { if (GetTileZ(tile) + 2 >= GetSnowLine()) return; } /* determine field size */ uint32_t r = (Random() & 0x303) + 0x404; - if (_settings_game.game_creation.landscape == LT_ARCTIC) r += 0x404; + if (_settings_game.game_creation.landscape == LandscapeType::Arctic) r += 0x404; uint size_x = GB(r, 0, 8); uint size_y = GB(r, 8, 8); @@ -1078,7 +1078,7 @@ static void PlantFarmField(TileIndex tile, IndustryID industry) } int type = 3; - if (_settings_game.game_creation.landscape != LT_ARCTIC && _settings_game.game_creation.landscape != LT_TROPIC) { + if (_settings_game.game_creation.landscape != LandscapeType::Arctic && _settings_game.game_creation.landscape != LandscapeType::Tropic) { type = _plantfarmfield_type[Random() & 0xF]; } @@ -1271,7 +1271,7 @@ static CommandCost CheckNewIndustry_NULL(TileIndex) */ static CommandCost CheckNewIndustry_Forest(TileIndex tile) { - if (_settings_game.game_creation.landscape == LT_ARCTIC) { + if (_settings_game.game_creation.landscape == LandscapeType::Arctic) { if (GetTileZ(tile) < HighestSnowLine() + 2) { return CommandCost(STR_ERROR_FOREST_CAN_ONLY_BE_PLANTED); } @@ -1340,7 +1340,7 @@ static CommandCost CheckNewIndustry_OilRig(TileIndex tile) */ static CommandCost CheckNewIndustry_Farm(TileIndex tile) { - if (_settings_game.game_creation.landscape == LT_ARCTIC) { + if (_settings_game.game_creation.landscape == LandscapeType::Arctic) { if (GetTileZ(tile) + 2 >= HighestSnowLine()) { return CommandCost(STR_ERROR_SITE_UNSUITABLE); } @@ -2289,7 +2289,7 @@ static Industry *CreateNewIndustry(TileIndex tile, IndustryType type, IndustryAv static uint32_t GetScaledIndustryGenerationProbability(IndustryType it, bool *force_at_least_one) { const IndustrySpec *ind_spc = GetIndustrySpec(it); - uint32_t chance = ind_spc->appear_creation[_settings_game.game_creation.landscape]; + uint32_t chance = ind_spc->appear_creation[to_underlying(_settings_game.game_creation.landscape)]; if (!ind_spc->enabled || ind_spc->layouts.empty() || (_game_mode != GM_EDITOR && _settings_game.difficulty.industry_density == ID_FUND_ONLY) || (chance = GetIndustryProbabilityCallback(it, IACT_MAPGENERATION, chance)) == 0) { @@ -2320,7 +2320,7 @@ static uint16_t GetIndustryGamePlayProbability(IndustryType it, uint8_t *min_num } const IndustrySpec *ind_spc = GetIndustrySpec(it); - uint8_t chance = ind_spc->appear_ingame[_settings_game.game_creation.landscape]; + uint8_t chance = ind_spc->appear_ingame[to_underlying(_settings_game.game_creation.landscape)]; if (!ind_spc->enabled || ind_spc->layouts.empty() || ((ind_spc->behaviour & INDUSTRYBEH_BEFORE_1950) && TimerGameCalendar::year > 1950) || ((ind_spc->behaviour & INDUSTRYBEH_AFTER_1960) && TimerGameCalendar::year < 1960) || @@ -2674,7 +2674,7 @@ static bool CheckIndustryCloseDownProtection(IndustryType type) const IndustrySpec *indspec = GetIndustrySpec(type); /* oil wells (or the industries with that flag set) are always allowed to closedown */ - if ((indspec->behaviour & INDUSTRYBEH_DONT_INCR_PROD) && _settings_game.game_creation.landscape == LT_TEMPERATE) return false; + if ((indspec->behaviour & INDUSTRYBEH_DONT_INCR_PROD) && _settings_game.game_creation.landscape == LandscapeType::Temperate) return false; return (indspec->behaviour & INDUSTRYBEH_CANCLOSE_LASTINSTANCE) == 0 && Industry::GetIndustryTypeCount(type) <= 1; } @@ -2843,7 +2843,7 @@ static void ChangeIndustryProduction(Industry *i, bool monthly) if (standard || (!callback_enabled && (indspec->life_type & (INDUSTRYLIFE_ORGANIC | INDUSTRYLIFE_EXTRACTIVE)) != 0)) { /* decrease or increase */ - bool only_decrease = (indspec->behaviour & INDUSTRYBEH_DONT_INCR_PROD) && _settings_game.game_creation.landscape == LT_TEMPERATE; + bool only_decrease = (indspec->behaviour & INDUSTRYBEH_DONT_INCR_PROD) && _settings_game.game_creation.landscape == LandscapeType::Temperate; if (original_economy) { if (only_decrease || Chance16(1, 3)) { diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 0c8595571b..c416345cdc 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -2717,10 +2717,10 @@ struct IndustryCargoesWindow : public Window { { HouseZones climate_mask; switch (_settings_game.game_creation.landscape) { - case LT_TEMPERATE: climate_mask = HZ_TEMP; break; - case LT_ARCTIC: climate_mask = HZ_SUBARTC_ABOVE | HZ_SUBARTC_BELOW; break; - case LT_TROPIC: climate_mask = HZ_SUBTROPIC; break; - case LT_TOYLAND: climate_mask = HZ_TOYLND; break; + case LandscapeType::Temperate: climate_mask = HZ_TEMP; break; + case LandscapeType::Arctic: climate_mask = HZ_SUBARTC_ABOVE | HZ_SUBARTC_BELOW; break; + case LandscapeType::Tropic: climate_mask = HZ_SUBTROPIC; break; + case LandscapeType::Toyland: climate_mask = HZ_TOYLND; break; default: NOT_REACHED(); } for (const CargoType cargo_type : cargoes) { diff --git a/src/industrytype.h b/src/industrytype.h index f27dc1e1f0..ae4316c615 100644 --- a/src/industrytype.h +++ b/src/industrytype.h @@ -116,7 +116,7 @@ struct IndustrySpec { std::array accepts_cargo; ///< 16 accepted cargoes. uint16_t input_cargo_multiplier[INDUSTRY_NUM_INPUTS][INDUSTRY_NUM_OUTPUTS]; ///< Input cargo multipliers (multiply amount of incoming cargo for the produced cargoes) IndustryLifeType life_type; ///< This is also known as Industry production flag, in newgrf specs - uint8_t climate_availability; ///< Bitmask, giving landscape enums as bit position + LandscapeTypes climate_availability; ///< Bitmask, giving landscape enums as bit position IndustryBehaviour behaviour; ///< How this industry will behave, and how others entities can use it uint8_t map_colour; ///< colour used for the small map StringID name; ///< Displayed name of the industry diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp index 54989a71b8..1cf2a2afa8 100644 --- a/src/intro_gui.cpp +++ b/src/intro_gui.cpp @@ -267,10 +267,10 @@ struct SelectGameWindow : public Window { void OnInvalidateData([[maybe_unused]] int data = 0, [[maybe_unused]] bool gui_scope = true) override { if (!gui_scope) return; - this->SetWidgetLoweredState(WID_SGI_TEMPERATE_LANDSCAPE, _settings_newgame.game_creation.landscape == LT_TEMPERATE); - this->SetWidgetLoweredState(WID_SGI_ARCTIC_LANDSCAPE, _settings_newgame.game_creation.landscape == LT_ARCTIC); - this->SetWidgetLoweredState(WID_SGI_TROPIC_LANDSCAPE, _settings_newgame.game_creation.landscape == LT_TROPIC); - this->SetWidgetLoweredState(WID_SGI_TOYLAND_LANDSCAPE, _settings_newgame.game_creation.landscape == LT_TOYLAND); + this->SetWidgetLoweredState(WID_SGI_TEMPERATE_LANDSCAPE, _settings_newgame.game_creation.landscape == LandscapeType::Temperate); + this->SetWidgetLoweredState(WID_SGI_ARCTIC_LANDSCAPE, _settings_newgame.game_creation.landscape == LandscapeType::Arctic); + this->SetWidgetLoweredState(WID_SGI_TROPIC_LANDSCAPE, _settings_newgame.game_creation.landscape == LandscapeType::Tropic); + this->SetWidgetLoweredState(WID_SGI_TOYLAND_LANDSCAPE, _settings_newgame.game_creation.landscape == LandscapeType::Toyland); } void OnInit() override @@ -355,7 +355,7 @@ struct SelectGameWindow : public Window { case WID_SGI_TEMPERATE_LANDSCAPE: case WID_SGI_ARCTIC_LANDSCAPE: case WID_SGI_TROPIC_LANDSCAPE: case WID_SGI_TOYLAND_LANDSCAPE: - SetNewLandscapeType(widget - WID_SGI_TEMPERATE_LANDSCAPE); + SetNewLandscapeType(LandscapeType(widget - WID_SGI_TEMPERATE_LANDSCAPE)); break; case WID_SGI_OPTIONS: ShowGameOptions(); break; diff --git a/src/landscape.cpp b/src/landscape.cpp index 6fb980657c..d14c5142b8 100644 --- a/src/landscape.cpp +++ b/src/landscape.cpp @@ -986,7 +986,7 @@ static bool FindSpring(TileIndex tile, void *) if (!IsTileFlat(tile, &reference_height) || IsWaterTile(tile)) return false; /* In the tropics rivers start in the rainforest. */ - if (_settings_game.game_creation.landscape == LT_TROPIC && GetTropicZone(tile) != TROPICZONE_RAINFOREST) return false; + if (_settings_game.game_creation.landscape == LandscapeType::Tropic && GetTropicZone(tile) != TROPICZONE_RAINFOREST) return false; /* Are there enough higher tiles to warrant a 'spring'? */ uint num = 0; @@ -1020,7 +1020,7 @@ static bool MakeLake(TileIndex tile, void *user_data) { uint height_lake = *static_cast(user_data); if (!IsValidTile(tile) || TileHeight(tile) != height_lake || !IsTileFlat(tile)) return false; - if (_settings_game.game_creation.landscape == LT_TROPIC && GetTropicZone(tile) == TROPICZONE_DESERT) return false; + if (_settings_game.game_creation.landscape == LandscapeType::Tropic && GetTropicZone(tile) == TROPICZONE_DESERT) return false; for (DiagDirection d = DIAGDIR_BEGIN; d < DIAGDIR_END; d++) { TileIndex t = tile + TileOffsByDiagDir(d); @@ -1368,7 +1368,7 @@ static std::tuple FlowRiver(TileIndex spring, TileIndex begin, uint /* We don't want the lake at the entry of the valley. */ lake_centre != begin && /* We don't want lakes in the desert. */ - (_settings_game.game_creation.landscape != LT_TROPIC || GetTropicZone(lake_centre) != TROPICZONE_DESERT) && + (_settings_game.game_creation.landscape != LandscapeType::Tropic || GetTropicZone(lake_centre) != TROPICZONE_DESERT) && /* We only want a lake if the river is long enough. */ DistanceManhattan(spring, lake_centre) > min_river_length) { end = lake_centre; @@ -1539,7 +1539,7 @@ bool GenerateLandscape(uint8_t mode) static constexpr uint GLS_ORIGINAL = 2; ///< Original generator static constexpr uint GLS_TROPIC = 12; ///< Extra steps needed for tropic landscape static constexpr uint GLS_OTHER = 0; ///< Extra steps for other landscapes - uint steps = (_settings_game.game_creation.landscape == LT_TROPIC) ? GLS_TROPIC : GLS_OTHER; + uint steps = (_settings_game.game_creation.landscape == LandscapeType::Tropic) ? GLS_TROPIC : GLS_OTHER; if (mode == GWM_HEIGHTMAP) { SetGeneratingWorldProgress(GWP_LANDSCAPE, steps + GLS_HEIGHTMAP); @@ -1557,7 +1557,7 @@ bool GenerateLandscape(uint8_t mode) for (uint y = 0; y < Map::SizeY(); y++) MakeVoid(TileXY(0, y)); } switch (_settings_game.game_creation.landscape) { - case LT_ARCTIC: { + case LandscapeType::Arctic: { uint32_t r = Random(); for (uint i = Map::ScaleBySize(GB(r, 0, 7) + 950); i != 0; --i) { @@ -1571,7 +1571,7 @@ bool GenerateLandscape(uint8_t mode) break; } - case LT_TROPIC: { + case LandscapeType::Tropic: { uint32_t r = Random(); for (uint i = Map::ScaleBySize(GB(r, 0, 7) + 170); i != 0; --i) { @@ -1616,11 +1616,11 @@ bool GenerateLandscape(uint8_t mode) IncreaseGeneratingWorldProgress(GWP_LANDSCAPE); switch (_settings_game.game_creation.landscape) { - case LT_ARCTIC: + case LandscapeType::Arctic: CalculateSnowLine(); break; - case LT_TROPIC: { + case LandscapeType::Tropic: { uint desert_tropic_line = CalculateDesertLine(); CreateDesertOrRainForest(desert_tropic_line); break; diff --git a/src/landscape_type.h b/src/landscape_type.h index d0868503c4..7a4f3dac54 100644 --- a/src/landscape_type.h +++ b/src/landscape_type.h @@ -11,17 +11,17 @@ #define LANDSCAPE_TYPE_H #include "core/enum_type.hpp" -typedef uint8_t LandscapeID; ///< Landscape type. @see LandscapeType /** Landscape types */ -enum LandscapeType : uint8_t { - LT_TEMPERATE = 0, - LT_ARCTIC = 1, - LT_TROPIC = 2, - LT_TOYLAND = 3, - - NUM_LANDSCAPE = 4, +enum class LandscapeType : uint8_t { + Temperate = 0, + Arctic = 1, + Tropic = 2, + Toyland = 3, }; +using LandscapeTypes = EnumBitSet; + +static constexpr uint NUM_LANDSCAPE = 4; /** * For storing the water borders which shall be retained. diff --git a/src/network/core/network_game_info.cpp b/src/network/core/network_game_info.cpp index 9fcfc47120..2630efdbe0 100644 --- a/src/network/core/network_game_info.cpp +++ b/src/network/core/network_game_info.cpp @@ -260,7 +260,7 @@ void SerializeNetworkGameInfo(Packet &p, const NetworkServerGameInfo &info, bool p.Send_uint8 (info.spectators_on); p.Send_uint16(info.map_width); p.Send_uint16(info.map_height); - p.Send_uint8 (info.landscape); + p.Send_uint8 (to_underlying(info.landscape)); p.Send_bool (info.dedicated); } @@ -365,10 +365,10 @@ void DeserializeNetworkGameInfo(Packet &p, NetworkGameInfo &info, const GameInfo if (game_info_version < 6) while (p.Recv_uint8() != 0) {} // Used to contain the map-name. info.map_width = p.Recv_uint16(); info.map_height = p.Recv_uint16(); - info.landscape = p.Recv_uint8 (); + info.landscape = LandscapeType{p.Recv_uint8()}; info.dedicated = p.Recv_bool (); - if (info.landscape >= NUM_LANDSCAPE) info.landscape = 0; + if (to_underlying(info.landscape) >= NUM_LANDSCAPE) info.landscape = LandscapeType::Temperate; } /* For older servers, estimate the ticks running based on the calendar date. */ diff --git a/src/network/core/network_game_info.h b/src/network/core/network_game_info.h index d28e4a6d13..2463f12c2b 100644 --- a/src/network/core/network_game_info.h +++ b/src/network/core/network_game_info.h @@ -17,6 +17,7 @@ #include "../../newgrf_config.h" #include "../../timer/timer_game_calendar.h" #include "../../timer/timer_game_tick.h" +#include "../../landscape_type.h" #include @@ -109,7 +110,7 @@ struct NetworkServerGameInfo { uint8_t companies_on; ///< How many started companies do we have uint8_t companies_max; ///< Max companies allowed on server uint8_t spectators_on; ///< How many spectators do we have? - uint8_t landscape; ///< The used landscape + LandscapeType landscape; ///< The used landscape int gamescript_version; ///< Version of the gamescript. std::string gamescript_name; ///< Name of the gamescript. }; diff --git a/src/network/network_admin.cpp b/src/network/network_admin.cpp index 4f61828f61..ba2d7b8632 100644 --- a/src/network/network_admin.cpp +++ b/src/network/network_admin.cpp @@ -175,7 +175,7 @@ NetworkRecvStatus ServerNetworkAdminSocketHandler::SendWelcome() p->Send_string(""); // Used to be map-name. p->Send_uint32(_settings_game.game_creation.generation_seed); - p->Send_uint8 (_settings_game.game_creation.landscape); + p->Send_uint8 (to_underlying(_settings_game.game_creation.landscape)); p->Send_uint32(TimerGameCalendar::ConvertYMDToDate(_settings_game.game_creation.starting_year, 0, 1).base()); p->Send_uint16(Map::SizeX()); p->Send_uint16(Map::SizeY()); diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index d6ab659e1d..a21d56e0ea 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -645,7 +645,7 @@ public: SetDParam(3, sel->info.companies_max); tr.top = DrawStringMultiLine(tr, STR_NETWORK_SERVER_LIST_CLIENTS); - SetDParam(0, STR_CLIMATE_TEMPERATE_LANDSCAPE + sel->info.landscape); + SetDParam(0, STR_CLIMATE_TEMPERATE_LANDSCAPE + to_underlying(sel->info.landscape)); tr.top = DrawStringMultiLine(tr, STR_NETWORK_SERVER_LIST_LANDSCAPE); // landscape SetDParam(0, sel->info.map_width); diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 151e855ed7..84402c472a 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -1034,7 +1034,7 @@ static ChangeInfoResult CommonVehicleChangeInfo(EngineInfo *ei, int prop, ByteRe break; case 0x06: // Climates available - ei->climates = buf.ReadByte(); + ei->climates = LandscapeTypes{buf.ReadByte()}; break; case PROP_VEHICLE_LOAD_AMOUNT: // 0x07 Loading speed @@ -2546,8 +2546,8 @@ static ChangeInfoResult TownHouseChangeInfo(uint first, uint last, int prop, Byt /* If value of goods is negative, it means in fact food or, if in toyland, fizzy_drink acceptance. * Else, we have "standard" 3rd cargo type, goods or candy, for toyland once more */ - CargoType cargo_type = (goods >= 0) ? ((_settings_game.game_creation.landscape == LT_TOYLAND) ? GetCargoTypeByLabel(CT_CANDY) : GetCargoTypeByLabel(CT_GOODS)) : - ((_settings_game.game_creation.landscape == LT_TOYLAND) ? GetCargoTypeByLabel(CT_FIZZY_DRINKS) : GetCargoTypeByLabel(CT_FOOD)); + CargoType cargo_type = (goods >= 0) ? ((_settings_game.game_creation.landscape == LandscapeType::Toyland) ? GetCargoTypeByLabel(CT_CANDY) : GetCargoTypeByLabel(CT_GOODS)) : + ((_settings_game.game_creation.landscape == LandscapeType::Toyland) ? GetCargoTypeByLabel(CT_FIZZY_DRINKS) : GetCargoTypeByLabel(CT_FOOD)); /* Make sure the cargo type is valid in this climate. */ if (!IsValidCargoType(cargo_type)) goods = 0; @@ -3820,11 +3820,11 @@ static ChangeInfoResult IndustriesChangeInfo(uint first, uint last, int prop, By break; case 0x17: // Probability in random game - indsp->appear_creation[_settings_game.game_creation.landscape] = buf.ReadByte(); + indsp->appear_creation[to_underlying(_settings_game.game_creation.landscape)] = buf.ReadByte(); break; case 0x18: // Probability during gameplay - indsp->appear_ingame[_settings_game.game_creation.landscape] = buf.ReadByte(); + indsp->appear_ingame[to_underlying(_settings_game.game_creation.landscape)] = buf.ReadByte(); break; case 0x19: // Map colour @@ -4215,7 +4215,7 @@ static ChangeInfoResult ObjectChangeInfo(uint first, uint last, int prop, ByteRe break; case 0x0B: // Climate mask - spec->climate = buf.ReadByte(); + spec->climate = LandscapeTypes{buf.ReadByte()}; break; case 0x0C: // Size @@ -6634,7 +6634,7 @@ bool GetGlobalVariable(uint8_t param, uint32_t *value, const GRFFile *grffile) } case 0x03: // current climate, 0=temp, 1=arctic, 2=trop, 3=toyland - *value = _settings_game.game_creation.landscape; + *value = to_underlying(_settings_game.game_creation.landscape); return true; case 0x06: // road traffic side, bit 4 clear=left, set=right @@ -6717,7 +6717,7 @@ bool GetGlobalVariable(uint8_t param, uint32_t *value, const GRFFile *grffile) case 0x20: { // snow line height uint8_t snowline = GetSnowLine(); - if (_settings_game.game_creation.landscape == LT_ARCTIC && snowline <= _settings_game.construction.map_height_limit) { + if (_settings_game.game_creation.landscape == LandscapeType::Arctic && snowline <= _settings_game.construction.map_height_limit) { *value = Clamp(snowline * (grffile->grf_version >= 8 ? 1 : TILE_HEIGHT), 0, 0xFE); } else { /* No snow */ @@ -9047,29 +9047,29 @@ static void CalculateRefitMasks() if (_gted[engine].defaultcargo_grf == nullptr) { /* If the vehicle has any capacity, apply the default refit masks */ if (e->type != VEH_TRAIN || e->u.rail.capacity != 0) { - static constexpr uint8_t T = 1 << LT_TEMPERATE; - static constexpr uint8_t A = 1 << LT_ARCTIC; - static constexpr uint8_t S = 1 << LT_TROPIC; - static constexpr uint8_t Y = 1 << LT_TOYLAND; + static constexpr LandscapeType T = LandscapeType::Temperate; + static constexpr LandscapeType A = LandscapeType::Arctic; + static constexpr LandscapeType S = LandscapeType::Tropic; + static constexpr LandscapeType Y = LandscapeType::Toyland; static const struct DefaultRefitMasks { - uint8_t climate; + LandscapeTypes climate; CargoLabel cargo_label; CargoClasses cargo_allowed; CargoClasses cargo_disallowed; } _default_refit_masks[] = { - {T | A | S | Y, CT_PASSENGERS, CC_PASSENGERS, 0}, - {T | A | S , CT_MAIL, CC_MAIL, 0}, - {T | A | S , CT_VALUABLES, CC_ARMOURED, CC_LIQUID}, - { Y, CT_MAIL, CC_MAIL | CC_ARMOURED, CC_LIQUID}, - {T | A , CT_COAL, CC_BULK, 0}, - { S , CT_COPPER_ORE, CC_BULK, 0}, - { Y, CT_SUGAR, CC_BULK, 0}, - {T | A | S , CT_OIL, CC_LIQUID, 0}, - { Y, CT_COLA, CC_LIQUID, 0}, - {T , CT_GOODS, CC_PIECE_GOODS | CC_EXPRESS, CC_LIQUID | CC_PASSENGERS}, - { A | S , CT_GOODS, CC_PIECE_GOODS | CC_EXPRESS, CC_LIQUID | CC_PASSENGERS | CC_REFRIGERATED}, - { A | S , CT_FOOD, CC_REFRIGERATED, 0}, - { Y, CT_CANDY, CC_PIECE_GOODS | CC_EXPRESS, CC_LIQUID | CC_PASSENGERS}, + {{T, A, S, Y}, CT_PASSENGERS, CC_PASSENGERS, 0}, + {{T, A, S }, CT_MAIL, CC_MAIL, 0}, + {{T, A, S }, CT_VALUABLES, CC_ARMOURED, CC_LIQUID}, + {{ Y}, CT_MAIL, CC_MAIL | CC_ARMOURED, CC_LIQUID}, + {{T, A }, CT_COAL, CC_BULK, 0}, + {{ S }, CT_COPPER_ORE, CC_BULK, 0}, + {{ Y}, CT_SUGAR, CC_BULK, 0}, + {{T, A, S }, CT_OIL, CC_LIQUID, 0}, + {{ Y}, CT_COLA, CC_LIQUID, 0}, + {{T }, CT_GOODS, CC_PIECE_GOODS | CC_EXPRESS, CC_LIQUID | CC_PASSENGERS}, + {{ A, S }, CT_GOODS, CC_PIECE_GOODS | CC_EXPRESS, CC_LIQUID | CC_PASSENGERS | CC_REFRIGERATED}, + {{ A, S }, CT_FOOD, CC_REFRIGERATED, 0}, + {{ Y}, CT_CANDY, CC_PIECE_GOODS | CC_EXPRESS, CC_LIQUID | CC_PASSENGERS}, }; if (e->type == VEH_AIRCRAFT) { @@ -9091,7 +9091,7 @@ static void CalculateRefitMasks() break; default: /* Cargo ships */ - if (_settings_game.game_creation.landscape == LT_TOYLAND) { + if (_settings_game.game_creation.landscape == LandscapeType::Toyland) { /* No tanker in toyland :( */ _gted[engine].cargo_allowed = CC_MAIL | CC_ARMOURED | CC_EXPRESS | CC_BULK | CC_PIECE_GOODS | CC_LIQUID; _gted[engine].cargo_disallowed = CC_PASSENGERS; @@ -9111,7 +9111,7 @@ static void CalculateRefitMasks() /* Train wagons and road vehicles are classified by their default cargo type */ CargoLabel label = GetActiveCargoLabel(ei->cargo_label); for (const auto &drm : _default_refit_masks) { - if (!HasBit(drm.climate, _settings_game.game_creation.landscape)) continue; + if (!drm.climate.Test(_settings_game.game_creation.landscape)) continue; if (drm.cargo_label != label) continue; _gted[engine].cargo_allowed = drm.cargo_allowed; @@ -9212,7 +9212,7 @@ static void CalculateRefitMasks() ei->cargo_type = static_cast(FindFirstBit(_standard_cargo_mask)); } } - if (!IsValidCargoType(ei->cargo_type)) ei->climates = 0; + if (!IsValidCargoType(ei->cargo_type)) ei->climates = {}; /* Clear refit_mask for not refittable ships */ if (e->type == VEH_SHIP && !e->u.ship.old_refittable) { @@ -9248,7 +9248,7 @@ static void FinaliseEngineArray() e->info.variant_id = GetNewEngineID(e->grf_prop.grffile, e->type, e->info.variant_id); } - if (!HasBit(e->info.climates, _settings_game.game_creation.landscape)) continue; + if (!e->info.climates.Test(_settings_game.game_creation.landscape)) continue; /* Skip wagons, there livery is defined via the engine */ if (e->type != VEH_TRAIN || e->u.rail.railveh_type != RAILVEH_WAGON) { @@ -9458,14 +9458,14 @@ static void FinaliseHouseArray() } } - HouseZones climate_mask = (HouseZones)(1 << (_settings_game.game_creation.landscape + 12)); + HouseZones climate_mask = (HouseZones)(1 << (to_underlying(_settings_game.game_creation.landscape) + 12)); EnsureEarlyHouse(HZ_ZON1 | climate_mask); EnsureEarlyHouse(HZ_ZON2 | climate_mask); EnsureEarlyHouse(HZ_ZON3 | climate_mask); EnsureEarlyHouse(HZ_ZON4 | climate_mask); EnsureEarlyHouse(HZ_ZON5 | climate_mask); - if (_settings_game.game_creation.landscape == LT_ARCTIC) { + if (_settings_game.game_creation.landscape == LandscapeType::Arctic) { EnsureEarlyHouse(HZ_ZON1 | HZ_SUBARTC_ABOVE); EnsureEarlyHouse(HZ_ZON2 | HZ_SUBARTC_ABOVE); EnsureEarlyHouse(HZ_ZON3 | HZ_SUBARTC_ABOVE); @@ -10039,14 +10039,14 @@ static void AfterLoadGRFs() } /* Road type is not available, so disable this engine */ - e->info.climates = 0; + e->info.climates = {}; } for (Engine *e : Engine::IterateType(VEH_TRAIN)) { RailType railtype = GetRailTypeByLabel(_gted[e->index].railtypelabel); if (railtype == INVALID_RAILTYPE) { /* Rail type is not available, so disable this engine */ - e->info.climates = 0; + e->info.climates = {}; } else { e->u.rail.railtype = railtype; e->u.rail.intended_railtype = railtype; diff --git a/src/newgrf_commons.cpp b/src/newgrf_commons.cpp index b45cb8abc2..f34a771825 100644 --- a/src/newgrf_commons.cpp +++ b/src/newgrf_commons.cpp @@ -335,8 +335,8 @@ void ObjectOverrideManager::SetEntitySpec(ObjectSpec *spec) uint32_t GetTerrainType(TileIndex tile, TileContext context) { switch (_settings_game.game_creation.landscape) { - case LT_TROPIC: return GetTropicZone(tile); - case LT_ARCTIC: { + case LandscapeType::Tropic: return GetTropicZone(tile); + case LandscapeType::Arctic: { bool has_snow; switch (GetTileType(tile)) { case MP_CLEAR: diff --git a/src/newgrf_object.cpp b/src/newgrf_object.cpp index d1e2a0eecf..7e0d1cc5ac 100644 --- a/src/newgrf_object.cpp +++ b/src/newgrf_object.cpp @@ -73,7 +73,7 @@ size_t ObjectSpec::Count() */ bool ObjectSpec::IsEverAvailable() const { - return this->IsEnabled() && HasBit(this->climate, _settings_game.game_creation.landscape) && + return this->IsEnabled() && this->climate.Test(_settings_game.game_creation.landscape) && (this->flags & ((_game_mode != GM_EDITOR && !_generating_world) ? OBJECT_FLAG_ONLY_IN_SCENEDIT : OBJECT_FLAG_ONLY_IN_GAME)) == 0; } diff --git a/src/newgrf_object.h b/src/newgrf_object.h index 732ae35634..0414b4dcb3 100644 --- a/src/newgrf_object.h +++ b/src/newgrf_object.h @@ -63,7 +63,7 @@ struct ObjectSpec : NewGRFSpecBase { AnimationInfo animation; ///< Information about the animation. StringID name; ///< The name for this object. - uint8_t climate; ///< In which climates is this object available? + LandscapeTypes climate; ///< In which climates is this object available? uint8_t size; ///< The size of this objects; low nibble for X, high nibble for Y. uint8_t build_cost_multiplier; ///< Build cost multiplier per tile. uint8_t clear_cost_multiplier; ///< Clear cost multiplier per tile. diff --git a/src/palette.cpp b/src/palette.cpp index c42f76c512..ca1dfbfe4c 100644 --- a/src/palette.cpp +++ b/src/palette.cpp @@ -325,7 +325,7 @@ void DoPaletteAnimations() } /* Dark blue water */ - s = (_settings_game.game_creation.landscape == LT_TOYLAND) ? ev->dark_water_toyland : ev->dark_water; + s = (_settings_game.game_creation.landscape == LandscapeType::Toyland) ? ev->dark_water_toyland : ev->dark_water; j = EXTR(320, EPV_CYCLES_DARK_WATER); for (uint i = 0; i != EPV_CYCLES_DARK_WATER; i++) { *palette_pos++ = s[j]; @@ -334,7 +334,7 @@ void DoPaletteAnimations() } /* Glittery water */ - s = (_settings_game.game_creation.landscape == LT_TOYLAND) ? ev->glitter_water_toyland : ev->glitter_water; + s = (_settings_game.game_creation.landscape == LandscapeType::Toyland) ? ev->glitter_water_toyland : ev->glitter_water; j = EXTR(128, EPV_CYCLES_GLITTER_WATER); for (uint i = 0; i != EPV_CYCLES_GLITTER_WATER / 3; i++) { *palette_pos++ = s[j]; diff --git a/src/rail.cpp b/src/rail.cpp index 55f55fb0f4..597653bfef 100644 --- a/src/rail.cpp +++ b/src/rail.cpp @@ -255,7 +255,7 @@ RailTypes GetCompanyRailTypes(CompanyID company, bool introduces) for (const Engine *e : Engine::IterateType(VEH_TRAIN)) { const EngineInfo *ei = &e->info; - if (HasBit(ei->climates, _settings_game.game_creation.landscape) && + if (ei->climates.Test(_settings_game.game_creation.landscape) && (HasBit(e->company_avail, company) || TimerGameCalendar::date >= e->intro_date + CalendarTime::DAYS_IN_YEAR)) { const RailVehicleInfo *rvi = &e->u.rail; @@ -285,7 +285,7 @@ RailTypes GetRailTypes(bool introduces) for (const Engine *e : Engine::IterateType(VEH_TRAIN)) { const EngineInfo *ei = &e->info; - if (!HasBit(ei->climates, _settings_game.game_creation.landscape)) continue; + if (!ei->climates.Test(_settings_game.game_creation.landscape)) continue; const RailVehicleInfo *rvi = &e->u.rail; if (rvi->railveh_type != RAILVEH_WAGON) { diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index bd7aecc937..5e1b927cc9 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -2596,7 +2596,7 @@ static void TileLoop_Track(TileIndex tile) } switch (_settings_game.game_creation.landscape) { - case LT_ARCTIC: { + case LandscapeType::Arctic: { auto [slope, z] = GetTileSlopeZ(tile); bool half = false; @@ -2652,12 +2652,15 @@ static void TileLoop_Track(TileIndex tile) break; } - case LT_TROPIC: + case LandscapeType::Tropic: if (GetTropicZone(tile) == TROPICZONE_DESERT) { new_ground = RAIL_GROUND_ICE_DESERT; goto set_ground; } break; + + default: + break; } new_ground = RAIL_GROUND_GRASS; diff --git a/src/road.cpp b/src/road.cpp index 3f546f5d33..1cfcb41f9e 100644 --- a/src/road.cpp +++ b/src/road.cpp @@ -203,7 +203,7 @@ RoadTypes GetCompanyRoadTypes(CompanyID company, bool introduces) for (const Engine *e : Engine::IterateType(VEH_ROAD)) { const EngineInfo *ei = &e->info; - if (HasBit(ei->climates, _settings_game.game_creation.landscape) && + if (ei->climates.Test(_settings_game.game_creation.landscape) && (HasBit(e->company_avail, company) || TimerGameCalendar::date >= e->intro_date + CalendarTime::DAYS_IN_YEAR)) { const RoadVehicleInfo *rvi = &e->u.road; assert(rvi->roadtype < ROADTYPE_END); @@ -230,7 +230,7 @@ RoadTypes GetRoadTypes(bool introduces) for (const Engine *e : Engine::IterateType(VEH_ROAD)) { const EngineInfo *ei = &e->info; - if (!HasBit(ei->climates, _settings_game.game_creation.landscape)) continue; + if (!ei->climates.Test(_settings_game.game_creation.landscape)) continue; const RoadVehicleInfo *rvi = &e->u.road; assert(rvi->roadtype < ROADTYPE_END); diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index 977f6dfe05..c9132f0e8d 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -1366,7 +1366,7 @@ static uint GetRoadSpriteOffset(Slope slope, RoadBits bits) static bool DrawRoadAsSnowDesert(bool snow_or_desert, Roadside roadside) { return (snow_or_desert && - !(_settings_game.game_creation.landscape == LT_TROPIC && HasGrfMiscBit(GMB_DESERT_PAVED_ROADS) && + !(_settings_game.game_creation.landscape == LandscapeType::Tropic && HasGrfMiscBit(GMB_DESERT_PAVED_ROADS) && roadside != ROADSIDE_BARREN && roadside != ROADSIDE_GRASS && roadside != ROADSIDE_GRASS_ROAD_WORKS)); } @@ -1979,7 +1979,7 @@ static_assert(lengthof(_town_road_types_2) == HZB_END); static void TileLoop_Road(TileIndex tile) { switch (_settings_game.game_creation.landscape) { - case LT_ARCTIC: { + case LandscapeType::Arctic: { /* Roads on flat foundations use the snow level of the height they are elevated to. All others use the snow level of their minimum height. */ int tile_z = (std::get(GetFoundationSlope(tile)) == SLOPE_FLAT) ? GetTileMaxZ(tile) : GetTileZ(tile); if (IsOnSnow(tile) != (tile_z > GetSnowLine())) { @@ -1989,12 +1989,15 @@ static void TileLoop_Road(TileIndex tile) break; } - case LT_TROPIC: + case LandscapeType::Tropic: if (GetTropicZone(tile) == TROPICZONE_DESERT && !IsOnDesert(tile)) { ToggleDesert(tile); MarkTileDirtyByTile(tile); } break; + + default: + break; } if (IsRoadDepot(tile)) return; @@ -2027,7 +2030,7 @@ static void TileLoop_Road(TileIndex tile) { /* Adjust road ground type depending on 'grp' (grp is the distance to the center) */ - const Roadside *new_rs = (_settings_game.game_creation.landscape == LT_TOYLAND) ? _town_road_types_2[grp] : _town_road_types[grp]; + const Roadside *new_rs = (_settings_game.game_creation.landscape == LandscapeType::Toyland) ? _town_road_types_2[grp] : _town_road_types[grp]; Roadside cur_rs = GetRoadside(tile); /* We have our desired type, do nothing */ diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 69d3f56900..cfceb63a23 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -2868,14 +2868,17 @@ bool AfterLoadGame() for (Town *t : Town::Iterate()) { /* Set the default cargo requirement for town growth */ switch (_settings_game.game_creation.landscape) { - case LT_ARCTIC: + case LandscapeType::Arctic: if (FindFirstCargoWithTownAcceptanceEffect(TAE_FOOD) != nullptr) t->goal[TAE_FOOD] = TOWN_GROWTH_WINTER; break; - case LT_TROPIC: + case LandscapeType::Tropic: if (FindFirstCargoWithTownAcceptanceEffect(TAE_FOOD) != nullptr) t->goal[TAE_FOOD] = TOWN_GROWTH_DESERT; if (FindFirstCargoWithTownAcceptanceEffect(TAE_WATER) != nullptr) t->goal[TAE_WATER] = TOWN_GROWTH_DESERT; break; + + default: + break; } } } diff --git a/src/saveload/oldloader_sl.cpp b/src/saveload/oldloader_sl.cpp index 292c129a60..c78c216483 100644 --- a/src/saveload/oldloader_sl.cpp +++ b/src/saveload/oldloader_sl.cpp @@ -404,7 +404,7 @@ static bool FixTTOEngines() TimerGameCalendar::date -= CalendarTime::DAYS_TILL_ORIGINAL_BASE_YEAR; /* Make sure for example monorail and maglev are available when they should be */ - if (TimerGameCalendar::date >= e->intro_date && HasBit(e->info.climates, 0)) { + if (TimerGameCalendar::date >= e->intro_date && e->info.climates.Test(LandscapeType::Temperate)) { e->flags.Set(EngineFlag::Available); e->company_avail = std::numeric_limits::max(); e->age = TimerGameCalendar::date > e->intro_date ? (TimerGameCalendar::date - e->intro_date).base() / 30 : 0; @@ -437,7 +437,7 @@ static bool FixTTOEngines() } } - e->info.climates = 1; + e->info.climates = LandscapeType::Temperate; } e->preview_company = INVALID_COMPANY; @@ -1794,7 +1794,7 @@ bool LoadTTDMain(LoadgameState *ls) FixTTDDepots(); /* Fix some general stuff */ - _settings_game.game_creation.landscape = _settings_game.game_creation.landscape & 0xF; + if (to_underlying(_settings_game.game_creation.landscape) >= NUM_LANDSCAPE) _settings_game.game_creation.landscape = LandscapeType::Temperate; /* Fix the game to be compatible with OpenTTD */ FixOldTowns(); @@ -1831,7 +1831,7 @@ bool LoadTTOMain(LoadgameState *ls) if (_settings_game.game_creation.town_name != 0) _settings_game.game_creation.town_name++; - _settings_game.game_creation.landscape = 0; + _settings_game.game_creation.landscape = LandscapeType::Temperate; _trees_tick_ctr = 0xFF; if (!FixTTOMapArray() || !FixTTOEngines()) { diff --git a/src/script/api/script_game.hpp b/src/script/api/script_game.hpp index b5fd62c524..76163162cc 100644 --- a/src/script/api/script_game.hpp +++ b/src/script/api/script_game.hpp @@ -24,10 +24,10 @@ public: */ enum LandscapeType { /* Note: these values represent part of the in-game LandscapeType enum */ - LT_TEMPERATE = ::LT_TEMPERATE, ///< Temperate climate. - LT_ARCTIC = ::LT_ARCTIC, ///< Arctic climate. - LT_TROPIC = ::LT_TROPIC, ///< Tropic climate. - LT_TOYLAND = ::LT_TOYLAND, ///< Toyland climate. + LT_TEMPERATE = to_underlying(::LandscapeType::Temperate), ///< Temperate climate. + LT_ARCTIC = to_underlying(::LandscapeType::Arctic), ///< Arctic climate. + LT_TROPIC = to_underlying(::LandscapeType::Tropic), ///< Tropic climate. + LT_TOYLAND = to_underlying(::LandscapeType::Toyland), ///< Toyland climate. }; /** diff --git a/src/script/api/script_industrytype.cpp b/src/script/api/script_industrytype.cpp index 964b7e61a4..91cde357b4 100644 --- a/src/script/api/script_industrytype.cpp +++ b/src/script/api/script_industrytype.cpp @@ -45,7 +45,7 @@ { if (!IsValidIndustryType(industry_type)) return false; - if (_settings_game.game_creation.landscape != LT_TEMPERATE) return true; + if (_settings_game.game_creation.landscape != LandscapeType::Temperate) return true; return (::GetIndustrySpec(industry_type)->behaviour & INDUSTRYBEH_DONT_INCR_PROD) == 0; } diff --git a/src/settings_type.h b/src/settings_type.h index c2f7aab53e..74280e906d 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -365,7 +365,7 @@ struct GameCreationSettings { uint8_t heightmap_rotation; ///< rotation director for the heightmap uint8_t se_flat_world_height; ///< land height a flat world gets in SE uint8_t town_name; ///< the town name generator used for town names - uint8_t landscape; ///< the landscape we're currently in + LandscapeType landscape; ///< the landscape we're currently in BorderFlags water_borders; ///< bitset of the borders that are water uint16_t custom_town_number; ///< manually entered number of towns uint16_t custom_industry_number; ///< manually entered number of industries diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index 13ca34ff11..14d7d79f11 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -559,7 +559,7 @@ static inline uint32_t GetSmallMapVegetationPixels(TileIndex tile, TileType t) case MP_TREES: if (GetTreeGround(tile) == TREE_GROUND_SNOW_DESERT || GetTreeGround(tile) == TREE_GROUND_ROUGH_SNOW) { - return (_settings_game.game_creation.landscape == LT_ARCTIC) ? MKCOLOUR_XYYX(PC_LIGHT_BLUE, PC_TREES) : MKCOLOUR_XYYX(PC_ORANGE, PC_TREES); + return (_settings_game.game_creation.landscape == LandscapeType::Arctic) ? MKCOLOUR_XYYX(PC_LIGHT_BLUE, PC_TREES) : MKCOLOUR_XYYX(PC_ORANGE, PC_TREES); } return (GetTropicZone(tile) == TROPICZONE_RAINFOREST) ? MKCOLOUR_XYYX(PC_RAINFOREST, PC_TREES) : MKCOLOUR_XYYX(PC_GRASS_LAND, PC_TREES); diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 3b74efeef1..deda6a22e6 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -335,7 +335,7 @@ static StringID GenerateStationName(Station *st, TileIndex tile, StationNaming n CountMapSquareAround(tile, CMSATree) >= 8 || CountMapSquareAround(tile, IsTileForestIndustry) >= 2) ) { - return _settings_game.game_creation.landscape == LT_TROPIC ? STR_SV_STNAME_FOREST : STR_SV_STNAME_WOODS; + return _settings_game.game_creation.landscape == LandscapeType::Tropic ? STR_SV_STNAME_FOREST : STR_SV_STNAME_WOODS; } /* check elevation compared to town */ @@ -3066,11 +3066,11 @@ bool SplitGroundSpriteForOverlay(const TileInfo *ti, SpriteID *ground, RailTrack if (ti != nullptr) { /* Decide snow/desert from tile */ switch (_settings_game.game_creation.landscape) { - case LT_ARCTIC: + case LandscapeType::Arctic: snow_desert = (uint)ti->z > GetSnowLine() * TILE_HEIGHT; break; - case LT_TROPIC: + case LandscapeType::Tropic: snow_desert = GetTropicZone(ti->tile) == TROPICZONE_DESERT; break; @@ -3630,14 +3630,14 @@ static void TileLoop_Station(TileIndex tile) case StationType::RoadWaypoint: { switch (_settings_game.game_creation.landscape) { - case LT_ARCTIC: + case LandscapeType::Arctic: if (IsRoadWaypointOnSnowOrDesert(tile) != (GetTileZ(tile) > GetSnowLine())) { ToggleRoadWaypointOnSnowOrDesert(tile); MarkTileDirtyByTile(tile); } break; - case LT_TROPIC: + case LandscapeType::Tropic: if (GetTropicZone(tile) == TROPICZONE_DESERT && !IsRoadWaypointOnSnowOrDesert(tile)) { ToggleRoadWaypointOnSnowOrDesert(tile); MarkTileDirtyByTile(tile); diff --git a/src/strings.cpp b/src/strings.cpp index 9279245d87..83d6a923f4 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -1831,7 +1831,7 @@ static const char _initial_name_letters[] = { static std::span GetSurnameOptions() { - if (_settings_game.game_creation.landscape == LT_TOYLAND) return _silly_surname_list; + if (_settings_game.game_creation.landscape == LandscapeType::Toyland) return _silly_surname_list; return _surname_list; } diff --git a/src/table/build_industry.h b/src/table/build_industry.h index c63eb404b1..841f66b43f 100644 --- a/src/table/build_industry.h +++ b/src/table/build_industry.h @@ -1151,7 +1151,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_POWER_STATION, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_COAL, 15, CT_INVALID, 0, 5, CT_INVALID, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_EXTRACTIVE, 1 << LT_TEMPERATE | 1 << LT_ARCTIC, + INDUSTRYLIFE_EXTRACTIVE, LandscapeTypes({LandscapeType::Temperate, LandscapeType::Arctic}), INDUSTRYBEH_CAN_SUBSIDENCE, STR_INDUSTRY_NAME_COAL_MINE, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_COAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1161,7 +1161,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_COAL_MINE, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_INVALID, 0, CT_INVALID, 0, 5, CT_COAL, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_BLACK_HOLE, 1 << LT_TEMPERATE | 1 << LT_ARCTIC, + INDUSTRYLIFE_BLACK_HOLE, LandscapeTypes({LandscapeType::Temperate, LandscapeType::Arctic}), INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_POWER_STATION, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1171,7 +1171,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_FOREST, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_GOODS, 0, CT_INVALID, 0, 5, CT_WOOD, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_PROCESSING, 1 << LT_TEMPERATE, + INDUSTRYLIFE_PROCESSING, LandscapeType::Temperate, INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_SAWMILL, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1181,7 +1181,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_SAWMILL, IT_PAPER_MILL, IT_INVALID, CHECK_FOREST, CT_WOOD, 13, CT_INVALID, 0, 30, CT_INVALID, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_ORGANIC, 1 << LT_TEMPERATE | 1 << LT_ARCTIC, + INDUSTRYLIFE_ORGANIC, LandscapeTypes({LandscapeType::Temperate, LandscapeType::Arctic}), INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_FOREST, STR_NEWS_INDUSTRY_PLANTED, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_FARM), @@ -1191,7 +1191,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_OIL_RIG, IT_INVALID, IT_INVALID, CHECK_REFINERY, CT_GOODS, 0, CT_INVALID, 0, 5, CT_OIL, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_PROCESSING, 1 << LT_TEMPERATE | 1 << LT_ARCTIC | 1 << LT_TROPIC, + INDUSTRYLIFE_PROCESSING, LandscapeTypes({LandscapeType::Temperate, LandscapeType::Arctic, LandscapeType::Tropic}), INDUSTRYBEH_AIRPLANE_ATTACKS, STR_INDUSTRY_NAME_OIL_REFINERY, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1201,7 +1201,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_OIL_REFINERY, IT_INVALID, IT_INVALID, CHECK_OIL_RIG, CT_OIL, 15, CT_PASSENGERS, 2, 5, CT_INVALID, 0, CT_INVALID, 0, CT_INVALID, 0, - INDUSTRYLIFE_EXTRACTIVE, 1 << LT_TEMPERATE, + INDUSTRYLIFE_EXTRACTIVE, LandscapeType::Temperate, INDUSTRYBEH_BUILT_ONWATER | INDUSTRYBEH_AFTER_1960 | INDUSTRYBEH_AI_AIRSHIP_ROUTES, STR_INDUSTRY_NAME_OIL_RIG, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_OIL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1211,7 +1211,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_FARM, IT_STEEL_MILL, IT_INVALID, CHECK_NOTHING, CT_GOODS, 0, CT_INVALID, 0, 5, MCT_LIVESTOCK_FRUIT, 256, MCT_GRAIN_WHEAT_MAIZE, 256, CT_STEEL, 256, - INDUSTRYLIFE_PROCESSING, 1 << LT_TEMPERATE, + INDUSTRYLIFE_PROCESSING, LandscapeType::Temperate, INDUSTRYBEH_CHOPPER_ATTACKS, STR_INDUSTRY_NAME_FACTORY, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1221,7 +1221,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_PAPER_MILL, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_GOODS, 0, CT_INVALID, 0, 5, CT_PAPER, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_PROCESSING, 1 << LT_ARCTIC, + INDUSTRYLIFE_PROCESSING, LandscapeType::Arctic, INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_PRINTING_WORKS, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1231,7 +1231,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_IRON_MINE, IT_FACTORY, IT_INVALID, CHECK_NOTHING, CT_STEEL, 0, CT_INVALID, 0, 5, CT_IRON_ORE, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_PROCESSING, 1 << LT_TEMPERATE, + INDUSTRYLIFE_PROCESSING, LandscapeType::Temperate, INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_STEEL_MILL, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1241,7 +1241,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_FACTORY, IT_FOOD_PROCESS, IT_INVALID, CHECK_FARM, MCT_GRAIN_WHEAT_MAIZE, 10, MCT_LIVESTOCK_FRUIT, 10, 5, CT_INVALID, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_ORGANIC, 1 << LT_TEMPERATE | 1 << LT_ARCTIC, + INDUSTRYLIFE_ORGANIC, LandscapeTypes({LandscapeType::Temperate, LandscapeType::Arctic}), INDUSTRYBEH_PLANT_FIELDS | INDUSTRYBEH_PLANT_ON_BUILT, STR_INDUSTRY_NAME_FARM, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_FARM, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_FARM), @@ -1251,7 +1251,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_FACTORY_2, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_COPPER_ORE, 10, CT_INVALID, 0, 5, CT_INVALID, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_EXTRACTIVE, 1 << LT_TROPIC, + INDUSTRYLIFE_EXTRACTIVE, LandscapeType::Tropic, INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_COPPER_ORE_MINE, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1261,7 +1261,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_OIL_REFINERY, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_OIL, 12, CT_INVALID, 0, 5, CT_INVALID, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_EXTRACTIVE, 1 << LT_TEMPERATE | 1 << LT_ARCTIC | 1 << LT_TROPIC, + INDUSTRYLIFE_EXTRACTIVE, LandscapeTypes({LandscapeType::Temperate, LandscapeType::Arctic, LandscapeType::Tropic}), INDUSTRYBEH_DONT_INCR_PROD | INDUSTRYBEH_BEFORE_1950, STR_INDUSTRY_NAME_OIL_WELLS, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_OIL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1271,7 +1271,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_BANK_TEMP, IT_INVALID, IT_INVALID, CHECK_NOTHING, MCT_VALUABLES_GOLD_DIAMONDS, 6, CT_INVALID, 0, 5, MCT_VALUABLES_GOLD_DIAMONDS, 0, CT_INVALID, 0, CT_INVALID, 0, - INDUSTRYLIFE_BLACK_HOLE, 1 << LT_TEMPERATE, + INDUSTRYLIFE_BLACK_HOLE, LandscapeType::Temperate, INDUSTRYBEH_TOWN1200_MORE, STR_INDUSTRY_NAME_BANK, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1281,7 +1281,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_FRUIT_PLANTATION, IT_FARM, IT_FARM_2, CHECK_NOTHING, CT_FOOD, 0, CT_INVALID, 0, 5, MCT_LIVESTOCK_FRUIT, 256, MCT_GRAIN_WHEAT_MAIZE, 256, CT_INVALID, 256, - INDUSTRYLIFE_PROCESSING, 1 << LT_ARCTIC | 1 << LT_TROPIC, + INDUSTRYLIFE_PROCESSING, LandscapeTypes({LandscapeType::Arctic, LandscapeType::Tropic}), INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_FOOD_PROCESSING_PLANT, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1291,7 +1291,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_FOREST, IT_PRINTING_WORKS, IT_INVALID, CHECK_NOTHING, CT_PAPER, 0, CT_INVALID, 0, 5, CT_WOOD, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_PROCESSING, 1 << LT_ARCTIC, + INDUSTRYLIFE_PROCESSING, LandscapeType::Arctic, INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_PAPER_MILL, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1301,7 +1301,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_BANK_TROPIC_ARCTIC, IT_INVALID, IT_INVALID, CHECK_NOTHING, MCT_VALUABLES_GOLD_DIAMONDS, 7, CT_INVALID, 0, 5, CT_INVALID, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_EXTRACTIVE, 1 << LT_ARCTIC, + INDUSTRYLIFE_EXTRACTIVE, LandscapeType::Arctic, INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_GOLD_MINE, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1311,7 +1311,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_GOLD_MINE, IT_DIAMOND_MINE, IT_INVALID, CHECK_NOTHING, CT_INVALID, 0, CT_INVALID, 0, 5, MCT_VALUABLES_GOLD_DIAMONDS, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_BLACK_HOLE, 1 << LT_ARCTIC | 1 << LT_TROPIC, + INDUSTRYLIFE_BLACK_HOLE, LandscapeTypes({LandscapeType::Arctic, LandscapeType::Tropic}), INDUSTRYBEH_ONLY_INTOWN, STR_INDUSTRY_NAME_BANK_TROPIC_ARCTIC, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1321,7 +1321,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_BANK_TROPIC_ARCTIC, IT_INVALID, IT_INVALID, CHECK_NOTHING, MCT_VALUABLES_GOLD_DIAMONDS, 7, CT_INVALID, 0, 5, CT_INVALID, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_EXTRACTIVE, 1 << LT_TROPIC, + INDUSTRYLIFE_EXTRACTIVE, LandscapeType::Tropic, INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_DIAMOND_MINE, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1331,7 +1331,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_STEEL_MILL, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_IRON_ORE, 10, CT_INVALID, 0, 5, CT_INVALID, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_EXTRACTIVE, 1 << LT_TEMPERATE, + INDUSTRYLIFE_EXTRACTIVE, LandscapeType::Temperate, INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_IRON_ORE_MINE, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1341,7 +1341,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_FOOD_PROCESS, IT_INVALID, IT_INVALID, CHECK_PLANTATION, MCT_LIVESTOCK_FRUIT, 10, CT_INVALID, 0, 15, CT_INVALID, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_ORGANIC, 1 << LT_TROPIC, + INDUSTRYLIFE_ORGANIC, LandscapeType::Tropic, INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_FRUIT_PLANTATION, STR_NEWS_INDUSTRY_PLANTED, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_FARM, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_FARM), @@ -1351,7 +1351,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_FACTORY_2, IT_INVALID, IT_INVALID, CHECK_PLANTATION, CT_RUBBER, 10, CT_INVALID, 0, 15, CT_INVALID, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_ORGANIC, 1 << LT_TROPIC, + INDUSTRYLIFE_ORGANIC, LandscapeType::Tropic, INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_RUBBER_PLANTATION, STR_NEWS_INDUSTRY_PLANTED, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_FARM, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_FARM), @@ -1361,7 +1361,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_WATER_TOWER, IT_INVALID, IT_INVALID, CHECK_WATER, CT_WATER, 12, CT_INVALID, 0, 5, CT_INVALID, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_EXTRACTIVE, 1 << LT_TROPIC, + INDUSTRYLIFE_EXTRACTIVE, LandscapeType::Tropic, INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_WATER_SUPPLY, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1371,7 +1371,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_WATER_SUPPLY, IT_INVALID, IT_INVALID, CHECK_WATER, CT_INVALID, 0, CT_INVALID, 0, 5, CT_WATER, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_BLACK_HOLE, 1 << LT_TROPIC, + INDUSTRYLIFE_BLACK_HOLE, LandscapeType::Tropic, INDUSTRYBEH_ONLY_INTOWN, STR_INDUSTRY_NAME_WATER_TOWER, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1381,7 +1381,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_RUBBER_PLANTATION, IT_COPPER_MINE, IT_LUMBER_MILL, CHECK_PLANTATION, CT_GOODS, 0, CT_INVALID, 0, 5, CT_RUBBER, 256, CT_COPPER_ORE, 256, CT_WOOD, 256, - INDUSTRYLIFE_PROCESSING, 1 << LT_TROPIC, + INDUSTRYLIFE_PROCESSING, LandscapeType::Tropic, INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_FACTORY_2, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1391,7 +1391,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_FOOD_PROCESS, IT_INVALID, IT_INVALID, CHECK_PLANTATION, MCT_GRAIN_WHEAT_MAIZE, 11, CT_INVALID, 0, 5, CT_INVALID, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_ORGANIC, 1 << LT_TROPIC, + INDUSTRYLIFE_ORGANIC, LandscapeType::Tropic, INDUSTRYBEH_PLANT_FIELDS | INDUSTRYBEH_PLANT_ON_BUILT, STR_INDUSTRY_NAME_FARM_2, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_FARM, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_FARM), @@ -1401,7 +1401,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_FACTORY_2, IT_INVALID, IT_INVALID, CHECK_LUMBERMILL, CT_WOOD, 0, CT_INVALID, 0, 5, CT_INVALID, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_PROCESSING, 1 << LT_TROPIC, + INDUSTRYLIFE_PROCESSING, LandscapeType::Tropic, INDUSTRYBEH_CUT_TREES, STR_INDUSTRY_NAME_LUMBER_MILL, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_LACK_OF_TREES, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1411,7 +1411,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_CANDY_FACTORY, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_COTTON_CANDY, 13, CT_INVALID, 0, 30, CT_INVALID, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_ORGANIC, 1 << LT_TOYLAND, + INDUSTRYLIFE_ORGANIC, LandscapeType::Toyland, INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_COTTON_CANDY_FOREST, STR_NEWS_INDUSTRY_PLANTED, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_FARM, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1421,7 +1421,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_COTTON_CANDY, IT_TOFFEE_QUARRY, IT_SUGAR_MINE, CHECK_NOTHING, CT_CANDY, 0, CT_INVALID, 0, 5, CT_SUGAR, 256, CT_TOFFEE, 256, CT_COTTON_CANDY, 256, - INDUSTRYLIFE_PROCESSING, 1 << LT_TOYLAND, + INDUSTRYLIFE_PROCESSING, LandscapeType::Toyland, INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_CANDY_FACTORY, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1431,7 +1431,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_TOY_FACTORY, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_BATTERIES, 11, CT_INVALID, 0, 30, CT_INVALID, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_ORGANIC, 1 << LT_TOYLAND, + INDUSTRYLIFE_ORGANIC, LandscapeType::Toyland, INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_BATTERY_FARM, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_FARM, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_FARM), @@ -1441,7 +1441,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_FIZZY_DRINK_FACTORY, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_COLA, 12, CT_INVALID, 0, 5, CT_INVALID, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_EXTRACTIVE, 1 << LT_TOYLAND, + INDUSTRYLIFE_EXTRACTIVE, LandscapeType::Toyland, INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_COLA_WELLS, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1451,7 +1451,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_TOY_FACTORY, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_INVALID, 0, CT_INVALID, 0, 5, CT_TOYS, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_BLACK_HOLE, 1 << LT_TOYLAND, + INDUSTRYLIFE_BLACK_HOLE, LandscapeType::Toyland, INDUSTRYBEH_ONLY_NEARTOWN, STR_INDUSTRY_NAME_TOY_SHOP, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1461,7 +1461,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_PLASTIC_FOUNTAINS, IT_BATTERY_FARM, IT_TOY_SHOP, CHECK_NOTHING, CT_TOYS, 0, CT_INVALID, 0, 5, CT_PLASTIC, 256, CT_BATTERIES, 256, CT_INVALID, 256, - INDUSTRYLIFE_PROCESSING, 1 << LT_TOYLAND, + INDUSTRYLIFE_PROCESSING, LandscapeType::Toyland, INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_TOY_FACTORY, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1471,7 +1471,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_TOY_FACTORY, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_PLASTIC, 14, CT_INVALID, 0, 5, CT_INVALID, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_EXTRACTIVE, 1 << LT_TOYLAND, + INDUSTRYLIFE_EXTRACTIVE, LandscapeType::Toyland, INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_PLASTIC_FOUNTAINS, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1481,7 +1481,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_COLA_WELLS, IT_BUBBLE_GENERATOR, IT_INVALID, CHECK_NOTHING, CT_FIZZY_DRINKS, 0, CT_INVALID, 0, 5, CT_COLA, 256, CT_BUBBLES, 256, CT_INVALID, 256, - INDUSTRYLIFE_PROCESSING, 1 << LT_TOYLAND, + INDUSTRYLIFE_PROCESSING, LandscapeType::Toyland, INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_FIZZY_DRINK_FACTORY, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_SUPPLY_PROBLEMS, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1491,7 +1491,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_FIZZY_DRINK_FACTORY, IT_INVALID, IT_INVALID, CHECK_BUBBLEGEN, CT_BUBBLES, 13, CT_INVALID, 0, 5, CT_INVALID, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_EXTRACTIVE, 1 << LT_TOYLAND, + INDUSTRYLIFE_EXTRACTIVE, LandscapeType::Toyland, INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_BUBBLE_GENERATOR, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1501,7 +1501,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_CANDY_FACTORY, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_TOFFEE, 10, CT_INVALID, 0, 5, CT_INVALID, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_EXTRACTIVE, 1 << LT_TOYLAND, + INDUSTRYLIFE_EXTRACTIVE, LandscapeType::Toyland, INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_TOFFEE_QUARRY, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), @@ -1511,7 +1511,7 @@ static const IndustrySpec _origin_industry_specs[NEW_INDUSTRYOFFSET] = { IT_CANDY_FACTORY, IT_INVALID, IT_INVALID, CHECK_NOTHING, CT_SUGAR, 11, CT_INVALID, 0, 5, CT_INVALID, 256, CT_INVALID, 256, CT_INVALID, 256, - INDUSTRYLIFE_EXTRACTIVE, 1 << LT_TOYLAND, + INDUSTRYLIFE_EXTRACTIVE, LandscapeType::Toyland, INDUSTRYBEH_NONE, STR_INDUSTRY_NAME_SUGAR_MINE, STR_NEWS_INDUSTRY_CONSTRUCTION, STR_NEWS_INDUSTRY_CLOSURE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_GENERAL, STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_GENERAL), diff --git a/src/table/engines.h b/src/table/engines.h index 5f673ef7d7..2e74123508 100644 --- a/src/table/engines.h +++ b/src/table/engines.h @@ -93,271 +93,271 @@ * A = Sub-Arctic * S = Sub-Tropic * Y = Toyland */ -#define T 1 -#define A 2 -#define S 4 -#define Y 8 +#define T LandscapeType::Temperate +#define A LandscapeType::Arctic +#define S LandscapeType::Tropic +#define Y LandscapeType::Toyland static constexpr EngineInfo _orig_engine_info[] = { /* base_intro base_life * | decay_speed cargo_type * | | lifelength | climates * | | | | | | */ - MT( 1827, 20, 15, 30, CT_NONE , T ), // 0 Kirby Paul Tank (Steam) - MT( 12784, 20, 22, 30, CT_NONE , A|S ), // 1 MJS 250 (Diesel) - MT( 9497, 20, 20, 50, CT_NONE , Y), // 2 Ploddyphut Choo-Choo - MT( 11688, 20, 20, 30, CT_NONE , Y), // 3 Powernaut Choo-Choo - MT( 16802, 20, 20, 30, CT_NONE , Y), // 4 Mightymover Choo-Choo - MT( 18993, 20, 20, 30, CT_NONE , Y), // 5 Ploddyphut Diesel - MT( 20820, 20, 20, 30, CT_NONE , Y), // 6 Powernaut Diesel - MT( 8766, 20, 20, 30, CT_NONE , A|S ), // 7 Wills 2-8-0 (Steam) - MT( 5114, 20, 21, 30, CT_NONE , T ), // 8 Chaney 'Jubilee' (Steam) - MT( 5479, 20, 20, 30, CT_NONE , T ), // 9 Ginzu 'A4' (Steam) - MT( 12419, 20, 23, 25, CT_NONE , T ), // 10 SH '8P' (Steam) - MM( 13149, 20, 12, 30, CT_PASSENGERS , T ), // 11 Manley-Morel DMU (Diesel) - MM( 23376, 20, 15, 35, CT_PASSENGERS , T ), // 12 'Dash' (Diesel) - MT( 14976, 20, 18, 28, CT_NONE , T ), // 13 SH/Hendry '25' (Diesel) - MT( 14245, 20, 20, 30, CT_NONE , T ), // 14 UU '37' (Diesel) - MT( 15341, 20, 22, 33, CT_NONE , T ), // 15 Floss '47' (Diesel) - MT( 14976, 20, 20, 25, CT_NONE , A|S ), // 16 CS 4000 (Diesel) - MT( 16437, 20, 20, 30, CT_NONE , A|S ), // 17 CS 2400 (Diesel) - MT( 18993, 20, 22, 30, CT_NONE , A|S ), // 18 Centennial (Diesel) - MT( 13880, 20, 22, 30, CT_NONE , A|S ), // 19 Kelling 3100 (Diesel) - MM( 20454, 20, 22, 30, CT_NONE , A|S ), // 20 Turner Turbo (Diesel) - MT( 16071, 20, 22, 30, CT_NONE , A|S ), // 21 MJS 1000 (Diesel) - MT( 20820, 20, 20, 25, CT_MAIL , T ), // 22 SH '125' (Diesel) - MT( 16437, 20, 23, 30, CT_NONE , T ), // 23 SH '30' (Electric) - MT( 19359, 20, 23, 80, CT_NONE , T ), // 24 SH '40' (Electric) - MM( 23376, 20, 25, 30, CT_NONE , T ), // 25 'T.I.M.' (Electric) - MM( 26298, 20, 25, 50, CT_NONE , T ), // 26 'AsiaStar' (Electric) - MW( 1827, 20, 20, 50, CT_PASSENGERS , T|A|S|Y), // 27 Passenger Carriage - MW( 1827, 20, 20, 50, CT_MAIL , T|A|S|Y), // 28 Mail Van - MW( 1827, 20, 20, 50, CT_COAL , T|A ), // 29 Coal Truck - MW( 1827, 20, 20, 50, CT_OIL , T|A|S ), // 30 Oil Tanker - MW( 1827, 20, 20, 50, CT_LIVESTOCK , T|A ), // 31 Livestock Van - MW( 1827, 20, 20, 50, CT_GOODS , T|A|S ), // 32 Goods Van - MW( 1827, 20, 20, 50, MCT_GRAIN_WHEAT_MAIZE, T|A|S ), // 33 Grain Hopper - MW( 1827, 20, 20, 50, CT_WOOD , T|A|S ), // 34 Wood Truck - MW( 1827, 20, 20, 50, CT_IRON_ORE , T ), // 35 Iron Ore Hopper - MW( 1827, 20, 20, 50, CT_STEEL , T ), // 36 Steel Truck - MW( 1827, 20, 20, 50, MCT_VALUABLES_GOLD_DIAMONDS, T|A|S ), // 37 Armoured Van - MW( 1827, 20, 20, 50, CT_FOOD , A|S ), // 38 Food Van - MW( 1827, 20, 20, 50, CT_PAPER , A ), // 39 Paper Truck - MW( 1827, 20, 20, 50, CT_COPPER_ORE , S ), // 40 Copper Ore Hopper - MW( 1827, 20, 20, 50, CT_WATER , S ), // 41 Water Tanker - MW( 1827, 20, 20, 50, CT_FRUIT , S ), // 42 Fruit Truck - MW( 1827, 20, 20, 50, CT_RUBBER , S ), // 43 Rubber Truck - MW( 1827, 20, 20, 50, CT_SUGAR , Y), // 44 Sugar Truck - MW( 1827, 20, 20, 50, CT_COTTON_CANDY, Y), // 45 Candyfloss Hopper - MW( 1827, 20, 20, 50, CT_TOFFEE , Y), // 46 Toffee Hopper - MW( 1827, 20, 20, 50, CT_BUBBLES , Y), // 47 Bubble Van - MW( 1827, 20, 20, 50, CT_COLA , Y), // 48 Cola Tanker - MW( 1827, 20, 20, 50, CT_CANDY , Y), // 49 Sweet Van - MW( 1827, 20, 20, 50, CT_TOYS , Y), // 50 Toy Van - MW( 1827, 20, 20, 50, CT_BATTERIES , Y), // 51 Battery Truck - MW( 1827, 20, 20, 50, CT_FIZZY_DRINKS, Y), // 52 Fizzy Drink Truck - MW( 1827, 20, 20, 50, CT_PLASTIC , Y), // 53 Plastic Truck - MT( 28490, 20, 20, 50, CT_NONE , T|A|S ), // 54 'X2001' (Electric) - MT( 31047, 20, 20, 50, CT_PASSENGERS , T|A|S ), // 55 'Millennium Z1' (Electric) - MT( 28855, 20, 20, 50, CT_NONE , Y), // 56 Wizzowow Z99 - MW( 1827, 20, 20, 50, CT_PASSENGERS , T|A|S|Y), // 57 Passenger Carriage - MW( 1827, 20, 20, 50, CT_MAIL , T|A|S|Y), // 58 Mail Van - MW( 1827, 20, 20, 50, CT_COAL , T|A ), // 59 Coal Truck - MW( 1827, 20, 20, 50, CT_OIL , T|A|S ), // 60 Oil Tanker - MW( 1827, 20, 20, 50, CT_LIVESTOCK , T|A ), // 61 Livestock Van - MW( 1827, 20, 20, 50, CT_GOODS , T|A|S ), // 62 Goods Van - MW( 1827, 20, 20, 50, MCT_GRAIN_WHEAT_MAIZE, T|A|S ), // 63 Grain Hopper - MW( 1827, 20, 20, 50, CT_WOOD , T|A|S ), // 64 Wood Truck - MW( 1827, 20, 20, 50, CT_IRON_ORE , T ), // 65 Iron Ore Hopper - MW( 1827, 20, 20, 50, CT_STEEL , T ), // 66 Steel Truck - MW( 1827, 20, 20, 50, MCT_VALUABLES_GOLD_DIAMONDS, T|A|S ), // 67 Armoured Van - MW( 1827, 20, 20, 50, CT_FOOD , A|S ), // 68 Food Van - MW( 1827, 20, 20, 50, CT_PAPER , A ), // 69 Paper Truck - MW( 1827, 20, 20, 50, CT_COPPER_ORE , S ), // 70 Copper Ore Hopper - MW( 1827, 20, 20, 50, CT_WATER , S ), // 71 Water Tanker - MW( 1827, 20, 20, 50, CT_FRUIT , S ), // 72 Fruit Truck - MW( 1827, 20, 20, 50, CT_RUBBER , S ), // 73 Rubber Truck - MW( 1827, 20, 20, 50, CT_SUGAR , Y), // 74 Sugar Truck - MW( 1827, 20, 20, 50, CT_COTTON_CANDY, Y), // 75 Candyfloss Hopper - MW( 1827, 20, 20, 50, CT_TOFFEE , Y), // 76 Toffee Hopper - MW( 1827, 20, 20, 50, CT_BUBBLES , Y), // 77 Bubble Van - MW( 1827, 20, 20, 50, CT_COLA , Y), // 78 Cola Tanker - MW( 1827, 20, 20, 50, CT_CANDY , Y), // 79 Sweet Van - MW( 1827, 20, 20, 50, CT_TOYS , Y), // 80 Toy Van - MW( 1827, 20, 20, 50, CT_BATTERIES , Y), // 81 Battery Truck - MW( 1827, 20, 20, 50, CT_FIZZY_DRINKS, Y), // 82 Fizzy Drink Truck - MW( 1827, 20, 20, 50, CT_PLASTIC , Y), // 83 Plastic Truck - MT( 36525, 20, 20, 50, CT_NONE , T|A|S ), // 84 Lev1 'Leviathan' (Electric) - MT( 39447, 20, 20, 50, CT_NONE , T|A|S ), // 85 Lev2 'Cyclops' (Electric) - MT( 42004, 20, 20, 50, CT_NONE , T|A|S ), // 86 Lev3 'Pegasus' (Electric) - MT( 42735, 20, 20, 50, CT_NONE , T|A|S ), // 87 Lev4 'Chimaera' (Electric) - MT( 36891, 20, 20, 60, CT_NONE , Y), // 88 Wizzowow Rocketeer - MW( 1827, 20, 20, 50, CT_PASSENGERS , T|A|S|Y), // 89 Passenger Carriage - MW( 1827, 20, 20, 50, CT_MAIL , T|A|S|Y), // 90 Mail Van - MW( 1827, 20, 20, 50, CT_COAL , T|A ), // 91 Coal Truck - MW( 1827, 20, 20, 50, CT_OIL , T|A|S ), // 92 Oil Tanker - MW( 1827, 20, 20, 50, CT_LIVESTOCK , T|A ), // 93 Livestock Van - MW( 1827, 20, 20, 50, CT_GOODS , T|A|S ), // 94 Goods Van - MW( 1827, 20, 20, 50, MCT_GRAIN_WHEAT_MAIZE, T|A|S ), // 95 Grain Hopper - MW( 1827, 20, 20, 50, CT_WOOD , T|A|S ), // 96 Wood Truck - MW( 1827, 20, 20, 50, CT_IRON_ORE , T ), // 97 Iron Ore Hopper - MW( 1827, 20, 20, 50, CT_STEEL , T ), // 98 Steel Truck - MW( 1827, 20, 20, 50, MCT_VALUABLES_GOLD_DIAMONDS, T|A|S ), // 99 Armoured Van - MW( 1827, 20, 20, 50, CT_FOOD , A|S ), // 100 Food Van - MW( 1827, 20, 20, 50, CT_PAPER , A ), // 101 Paper Truck - MW( 1827, 20, 20, 50, CT_COPPER_ORE , S ), // 102 Copper Ore Hopper - MW( 1827, 20, 20, 50, CT_WATER , S ), // 103 Water Tanker - MW( 1827, 20, 20, 50, CT_FRUIT , S ), // 104 Fruit Truck - MW( 1827, 20, 20, 50, CT_RUBBER , S ), // 105 Rubber Truck - MW( 1827, 20, 20, 50, CT_SUGAR , Y), // 106 Sugar Truck - MW( 1827, 20, 20, 50, CT_COTTON_CANDY, Y), // 107 Candyfloss Hopper - MW( 1827, 20, 20, 50, CT_TOFFEE , Y), // 108 Toffee Hopper - MW( 1827, 20, 20, 50, CT_BUBBLES , Y), // 109 Bubble Van - MW( 1827, 20, 20, 50, CT_COLA , Y), // 110 Cola Tanker - MW( 1827, 20, 20, 50, CT_CANDY , Y), // 111 Sweet Van - MW( 1827, 20, 20, 50, CT_TOYS , Y), // 112 Toy Van - MW( 1827, 20, 20, 50, CT_BATTERIES , Y), // 113 Battery Truck - MW( 1827, 20, 20, 50, CT_FIZZY_DRINKS, Y), // 114 Fizzy Drink Truck - MW( 1827, 20, 20, 50, CT_PLASTIC , Y), // 115 Plastic Truck - MR( 3378, 20, 12, 40, CT_PASSENGERS , T|A|S ), // 116 MPS Regal Bus - MR( 16071, 20, 15, 30, CT_PASSENGERS , T|A|S ), // 117 Hereford Leopard Bus - MR( 24107, 20, 15, 40, CT_PASSENGERS , T|A|S ), // 118 Foster Bus - MR( 32142, 20, 15, 80, CT_PASSENGERS , T|A|S ), // 119 Foster MkII Superbus - MR( 9132, 20, 15, 40, CT_PASSENGERS , Y), // 120 Ploddyphut MkI Bus - MR( 18993, 20, 15, 40, CT_PASSENGERS , Y), // 121 Ploddyphut MkII Bus - MR( 32873, 20, 15, 80, CT_PASSENGERS , Y), // 122 Ploddyphut MkIII Bus - MR( 5479, 20, 15, 55, CT_COAL , T|A ), // 123 Balogh Coal Truck - MR( 20089, 20, 15, 55, CT_COAL , T|A ), // 124 Uhl Coal Truck - MR( 33969, 20, 15, 85, CT_COAL , T|A ), // 125 DW Coal Truck - MR( 5479, 20, 15, 55, CT_MAIL , T|A|S ), // 126 MPS Mail Truck - MR( 21550, 20, 15, 55, CT_MAIL , T|A|S ), // 127 Reynard Mail Truck - MR( 35795, 20, 15, 85, CT_MAIL , T|A|S ), // 128 Perry Mail Truck - MR( 5479, 20, 15, 55, CT_MAIL , Y), // 129 MightyMover Mail Truck - MR( 21550, 20, 15, 55, CT_MAIL , Y), // 130 Powernaught Mail Truck - MR( 35795, 20, 15, 85, CT_MAIL , Y), // 131 Wizzowow Mail Truck - MR( 5479, 20, 15, 55, CT_OIL , T|A|S ), // 132 Witcombe Oil Tanker - MR( 19359, 20, 15, 55, CT_OIL , T|A|S ), // 133 Foster Oil Tanker - MR( 31047, 20, 15, 85, CT_OIL , T|A|S ), // 134 Perry Oil Tanker - MR( 5479, 20, 15, 55, CT_LIVESTOCK , T|A ), // 135 Talbott Livestock Van - MR( 21915, 20, 15, 55, CT_LIVESTOCK , T|A ), // 136 Uhl Livestock Van - MR( 37256, 20, 15, 85, CT_LIVESTOCK , T|A ), // 137 Foster Livestock Van - MR( 5479, 20, 15, 55, CT_GOODS , T|A|S ), // 138 Balogh Goods Truck - MR( 19724, 20, 15, 55, CT_GOODS , T|A|S ), // 139 Craighead Goods Truck - MR( 31047, 20, 15, 85, CT_GOODS , T|A|S ), // 140 Goss Goods Truck - MR( 5479, 20, 15, 55, MCT_GRAIN_WHEAT_MAIZE, T|A|S ), // 141 Hereford Grain Truck - MR( 21185, 20, 15, 55, MCT_GRAIN_WHEAT_MAIZE, T|A|S ), // 142 Thomas Grain Truck - MR( 32873, 20, 15, 85, MCT_GRAIN_WHEAT_MAIZE, T|A|S ), // 143 Goss Grain Truck - MR( 5479, 20, 15, 55, CT_WOOD , T|A|S ), // 144 Witcombe Wood Truck - MR( 19724, 20, 15, 55, CT_WOOD , T|A|S ), // 145 Foster Wood Truck - MR( 35430, 20, 15, 85, CT_WOOD , T|A|S ), // 146 Moreland Wood Truck - MR( 5479, 20, 15, 55, CT_IRON_ORE , T ), // 147 MPS Iron Ore Truck - MR( 20820, 20, 15, 55, CT_IRON_ORE , T ), // 148 Uhl Iron Ore Truck - MR( 33238, 20, 15, 85, CT_IRON_ORE , T ), // 149 Chippy Iron Ore Truck - MR( 5479, 20, 15, 55, CT_STEEL , T ), // 150 Balogh Steel Truck - MR( 21185, 20, 15, 55, CT_STEEL , T ), // 151 Uhl Steel Truck - MR( 31777, 20, 15, 85, CT_STEEL , T ), // 152 Kelling Steel Truck - MR( 5479, 20, 15, 55, MCT_VALUABLES_GOLD_DIAMONDS, T|A|S ), // 153 Balogh Armoured Truck - MR( 22281, 20, 15, 55, MCT_VALUABLES_GOLD_DIAMONDS, T|A|S ), // 154 Uhl Armoured Truck - MR( 33603, 20, 15, 85, MCT_VALUABLES_GOLD_DIAMONDS, T|A|S ), // 155 Foster Armoured Truck - MR( 5479, 20, 15, 55, CT_FOOD , A|S ), // 156 Foster Food Van - MR( 18628, 20, 15, 55, CT_FOOD , A|S ), // 157 Perry Food Van - MR( 30681, 20, 15, 85, CT_FOOD , A|S ), // 158 Chippy Food Van - MR( 5479, 20, 15, 55, CT_PAPER , A ), // 159 Uhl Paper Truck - MR( 21185, 20, 15, 55, CT_PAPER , A ), // 160 Balogh Paper Truck - MR( 31777, 20, 15, 85, CT_PAPER , A ), // 161 MPS Paper Truck - MR( 5479, 20, 15, 55, CT_COPPER_ORE , S ), // 162 MPS Copper Ore Truck - MR( 20820, 20, 15, 55, CT_COPPER_ORE , S ), // 163 Uhl Copper Ore Truck - MR( 33238, 20, 15, 85, CT_COPPER_ORE , S ), // 164 Goss Copper Ore Truck - MR( 5479, 20, 15, 55, CT_WATER , S ), // 165 Uhl Water Tanker - MR( 20970, 20, 15, 55, CT_WATER , S ), // 166 Balogh Water Tanker - MR( 33388, 20, 15, 85, CT_WATER , S ), // 167 MPS Water Tanker - MR( 5479, 20, 15, 55, CT_FRUIT , S ), // 168 Balogh Fruit Truck - MR( 21335, 20, 15, 55, CT_FRUIT , S ), // 169 Uhl Fruit Truck - MR( 33753, 20, 15, 85, CT_FRUIT , S ), // 170 Kelling Fruit Truck - MR( 5479, 20, 15, 55, CT_RUBBER , S ), // 171 Balogh Rubber Truck - MR( 20604, 20, 15, 55, CT_RUBBER , S ), // 172 Uhl Rubber Truck - MR( 33023, 20, 15, 85, CT_RUBBER , S ), // 173 RMT Rubber Truck - MR( 5479, 20, 15, 55, CT_SUGAR , Y), // 174 MightyMover Sugar Truck - MR( 19724, 20, 15, 55, CT_SUGAR , Y), // 175 Powernaught Sugar Truck - MR( 33238, 20, 15, 85, CT_SUGAR , Y), // 176 Wizzowow Sugar Truck - MR( 5479, 20, 15, 55, CT_COLA , Y), // 177 MightyMover Cola Truck - MR( 20089, 20, 15, 55, CT_COLA , Y), // 178 Powernaught Cola Truck - MR( 33603, 20, 15, 85, CT_COLA , Y), // 179 Wizzowow Cola Truck - MR( 5479, 20, 15, 55, CT_COTTON_CANDY, Y), // 180 MightyMover Candyfloss Truck - MR( 20454, 20, 15, 55, CT_COTTON_CANDY, Y), // 181 Powernaught Candyfloss Truck - MR( 33969, 20, 15, 85, CT_COTTON_CANDY, Y), // 182 Wizzowow Candyfloss Truck - MR( 5479, 20, 15, 55, CT_TOFFEE , Y), // 183 MightyMover Toffee Truck - MR( 20820, 20, 15, 55, CT_TOFFEE , Y), // 184 Powernaught Toffee Truck - MR( 34334, 20, 15, 85, CT_TOFFEE , Y), // 185 Wizzowow Toffee Truck - MR( 5479, 20, 15, 55, CT_TOYS , Y), // 186 MightyMover Toy Van - MR( 21185, 20, 15, 55, CT_TOYS , Y), // 187 Powernaught Toy Van - MR( 34699, 20, 15, 85, CT_TOYS , Y), // 188 Wizzowow Toy Van - MR( 5479, 20, 15, 55, CT_CANDY , Y), // 189 MightyMover Sweet Truck - MR( 21550, 20, 15, 55, CT_CANDY , Y), // 190 Powernaught Sweet Truck - MR( 35064, 20, 15, 85, CT_CANDY , Y), // 191 Wizzowow Sweet Truck - MR( 5479, 20, 15, 55, CT_BATTERIES , Y), // 192 MightyMover Battery Truck - MR( 19874, 20, 15, 55, CT_BATTERIES , Y), // 193 Powernaught Battery Truck - MR( 35430, 20, 15, 85, CT_BATTERIES , Y), // 194 Wizzowow Battery Truck - MR( 5479, 20, 15, 55, CT_FIZZY_DRINKS, Y), // 195 MightyMover Fizzy Drink Truck - MR( 20239, 20, 15, 55, CT_FIZZY_DRINKS, Y), // 196 Powernaught Fizzy Drink Truck - MR( 35795, 20, 15, 85, CT_FIZZY_DRINKS, Y), // 197 Wizzowow Fizzy Drink Truck - MR( 5479, 20, 15, 55, CT_PLASTIC , Y), // 198 MightyMover Plastic Truck - MR( 20604, 20, 15, 55, CT_PLASTIC , Y), // 199 Powernaught Plastic Truck - MR( 32873, 20, 15, 85, CT_PLASTIC , Y), // 200 Wizzowow Plastic Truck - MR( 5479, 20, 15, 55, CT_BUBBLES , Y), // 201 MightyMover Bubble Truck - MR( 20970, 20, 15, 55, CT_BUBBLES , Y), // 202 Powernaught Bubble Truck - MR( 33023, 20, 15, 85, CT_BUBBLES , Y), // 203 Wizzowow Bubble Truck - MS( 2922, 5, 30, 50, CT_OIL , T|A|S ), // 204 MPS Oil Tanker - MS( 17167, 5, 30, 90, CT_OIL , T|A|S ), // 205 CS-Inc. Oil Tanker - MS( 2192, 5, 30, 55, CT_PASSENGERS , T|A|S ), // 206 MPS Passenger Ferry - MS( 18628, 5, 30, 90, CT_PASSENGERS , T|A|S ), // 207 FFP Passenger Ferry - MS( 17257, 10, 25, 90, CT_PASSENGERS , T|A|S ), // 208 Bakewell 300 Hovercraft - MS( 9587, 5, 30, 40, CT_PASSENGERS , Y), // 209 Chugger-Chug Passenger Ferry - MS( 20544, 5, 30, 90, CT_PASSENGERS , Y), // 210 Shivershake Passenger Ferry - MS( 2557, 5, 30, 55, CT_GOODS , T|A|S ), // 211 Yate Cargo ship - MS( 19724, 5, 30, 98, CT_GOODS , T|A|S ), // 212 Bakewell Cargo ship - MS( 9587, 5, 30, 45, CT_GOODS , Y), // 213 Mightymover Cargo ship - MS( 22371, 5, 30, 90, CT_GOODS , Y), // 214 Powernaut Cargo ship - MA( 2922, 20, 20, 20, T|A|S ), // 215 Sampson U52 - MA( 9922, 20, 24, 20, T|A|S ), // 216 Coleman Count - MA( 12659, 20, 18, 20, T|A|S ), // 217 FFP Dart - MA( 17652, 20, 25, 35, T|A|S ), // 218 Yate Haugan - MA( 4929, 20, 30, 30, T|A|S ), // 219 Bakewell Cotswald LB-3 - MA( 13695, 20, 23, 25, T|A|S ), // 220 Bakewell Luckett LB-8 - MA( 16341, 20, 26, 30, T|A|S ), // 221 Bakewell Luckett LB-9 - MA( 21395, 20, 25, 30, T|A|S ), // 222 Bakewell Luckett LB80 - MA( 18263, 20, 20, 30, T|A|S ), // 223 Bakewell Luckett LB-10 - MA( 25233, 20, 25, 30, T|A|S ), // 224 Bakewell Luckett LB-11 - MA( 15371, 20, 22, 25, T|A|S ), // 225 Yate Aerospace YAC 1-11 - MA( 15461, 20, 25, 25, T|A|S ), // 226 Darwin 100 - MA( 16952, 20, 22, 25, T|A|S ), // 227 Darwin 200 - MA( 17227, 20, 25, 30, T|A|S ), // 228 Darwin 300 - MA( 22371, 20, 25, 35, T|A|S ), // 229 Darwin 400 - MA( 22341, 20, 25, 30, T|A|S ), // 230 Darwin 500 - MA( 27209, 20, 25, 30, T|A|S ), // 231 Darwin 600 - MA( 17988, 20, 20, 30, T|A|S ), // 232 Guru Galaxy - MA( 18993, 20, 24, 35, T|A|S ), // 233 Airtaxi A21 - MA( 22401, 20, 24, 30, T|A|S ), // 234 Airtaxi A31 - MA( 24472, 20, 24, 30, T|A|S ), // 235 Airtaxi A32 - MA( 26724, 20, 24, 30, T|A|S ), // 236 Airtaxi A33 - MA( 22005, 20, 25, 30, T|A|S ), // 237 Yate Aerospace YAe46 - MA( 24107, 20, 20, 35, T|A|S ), // 238 Dinger 100 - MA( 29310, 20, 25, 60, T|A|S ), // 239 AirTaxi A34-1000 - MA( 35520, 20, 22, 30, T|A|S ), // 240 Yate Z-Shuttle - MA( 36981, 20, 22, 30, T|A|S ), // 241 Kelling K1 - MA( 38807, 20, 22, 50, T|A|S ), // 242 Kelling K6 - MA( 42094, 20, 25, 30, T|A|S ), // 243 Kelling K7 - MA( 44651, 20, 23, 30, T|A|S ), // 244 Darwin 700 - MA( 40268, 20, 25, 30, T|A|S ), // 245 FFP Hyperdart 2 - MA( 33693, 20, 25, 50, T|A|S ), // 246 Dinger 200 - MA( 32963, 20, 20, 60, T|A|S ), // 247 Dinger 1000 - MA( 9222, 20, 20, 35, Y), // 248 Ploddyphut 100 - MA( 12874, 20, 20, 35, Y), // 249 Ploddyphut 500 - MA( 16892, 20, 20, 35, Y), // 250 Flashbang X1 - MA( 21275, 20, 20, 99, Y), // 251 Juggerplane M1 - MA( 23832, 20, 20, 99, Y), // 252 Flashbang Wizzer - MA( 13575, 20, 20, 40, T|A|S ), // 253 Tricario Helicopter - MA( 28215, 20, 20, 30, T|A|S ), // 254 Guru X2 Helicopter - MA( 13575, 20, 20, 99, Y), // 255 Powernaut Helicopter + MT( 1827, 20, 15, 30, CT_NONE , LandscapeTypes({T })), // 0 Kirby Paul Tank (Steam) + MT( 12784, 20, 22, 30, CT_NONE , LandscapeTypes({ A,S })), // 1 MJS 250 (Diesel) + MT( 9497, 20, 20, 50, CT_NONE , LandscapeTypes({ Y})), // 2 Ploddyphut Choo-Choo + MT( 11688, 20, 20, 30, CT_NONE , LandscapeTypes({ Y})), // 3 Powernaut Choo-Choo + MT( 16802, 20, 20, 30, CT_NONE , LandscapeTypes({ Y})), // 4 Mightymover Choo-Choo + MT( 18993, 20, 20, 30, CT_NONE , LandscapeTypes({ Y})), // 5 Ploddyphut Diesel + MT( 20820, 20, 20, 30, CT_NONE , LandscapeTypes({ Y})), // 6 Powernaut Diesel + MT( 8766, 20, 20, 30, CT_NONE , LandscapeTypes({ A,S })), // 7 Wills 2-8-0 (Steam) + MT( 5114, 20, 21, 30, CT_NONE , LandscapeTypes({T })), // 8 Chaney 'Jubilee' (Steam) + MT( 5479, 20, 20, 30, CT_NONE , LandscapeTypes({T })), // 9 Ginzu 'A4' (Steam) + MT( 12419, 20, 23, 25, CT_NONE , LandscapeTypes({T })), // 10 SH '8P' (Steam) + MM( 13149, 20, 12, 30, CT_PASSENGERS , LandscapeTypes({T })), // 11 Manley-Morel DMU (Diesel) + MM( 23376, 20, 15, 35, CT_PASSENGERS , LandscapeTypes({T })), // 12 'Dash' (Diesel) + MT( 14976, 20, 18, 28, CT_NONE , LandscapeTypes({T })), // 13 SH/Hendry '25' (Diesel) + MT( 14245, 20, 20, 30, CT_NONE , LandscapeTypes({T })), // 14 UU '37' (Diesel) + MT( 15341, 20, 22, 33, CT_NONE , LandscapeTypes({T })), // 15 Floss '47' (Diesel) + MT( 14976, 20, 20, 25, CT_NONE , LandscapeTypes({ A,S })), // 16 CS 4000 (Diesel) + MT( 16437, 20, 20, 30, CT_NONE , LandscapeTypes({ A,S })), // 17 CS 2400 (Diesel) + MT( 18993, 20, 22, 30, CT_NONE , LandscapeTypes({ A,S })), // 18 Centennial (Diesel) + MT( 13880, 20, 22, 30, CT_NONE , LandscapeTypes({ A,S })), // 19 Kelling 3100 (Diesel) + MM( 20454, 20, 22, 30, CT_NONE , LandscapeTypes({ A,S })), // 20 Turner Turbo (Diesel) + MT( 16071, 20, 22, 30, CT_NONE , LandscapeTypes({ A,S })), // 21 MJS 1000 (Diesel) + MT( 20820, 20, 20, 25, CT_MAIL , LandscapeTypes({T })), // 22 SH '125' (Diesel) + MT( 16437, 20, 23, 30, CT_NONE , LandscapeTypes({T })), // 23 SH '30' (Electric) + MT( 19359, 20, 23, 80, CT_NONE , LandscapeTypes({T })), // 24 SH '40' (Electric) + MM( 23376, 20, 25, 30, CT_NONE , LandscapeTypes({T })), // 25 'T.I.M.' (Electric) + MM( 26298, 20, 25, 50, CT_NONE , LandscapeTypes({T })), // 26 'AsiaStar' (Electric) + MW( 1827, 20, 20, 50, CT_PASSENGERS , LandscapeTypes({T,A,S,Y})), // 27 Passenger Carriage + MW( 1827, 20, 20, 50, CT_MAIL , LandscapeTypes({T,A,S,Y})), // 28 Mail Van + MW( 1827, 20, 20, 50, CT_COAL , LandscapeTypes({T,A })), // 29 Coal Truck + MW( 1827, 20, 20, 50, CT_OIL , LandscapeTypes({T,A,S })), // 30 Oil Tanker + MW( 1827, 20, 20, 50, CT_LIVESTOCK , LandscapeTypes({T,A })), // 31 Livestock Van + MW( 1827, 20, 20, 50, CT_GOODS , LandscapeTypes({T,A,S })), // 32 Goods Van + MW( 1827, 20, 20, 50, MCT_GRAIN_WHEAT_MAIZE, LandscapeTypes({T,A,S })), // 33 Grain Hopper + MW( 1827, 20, 20, 50, CT_WOOD , LandscapeTypes({T,A,S })), // 34 Wood Truck + MW( 1827, 20, 20, 50, CT_IRON_ORE , LandscapeTypes({T })), // 35 Iron Ore Hopper + MW( 1827, 20, 20, 50, CT_STEEL , LandscapeTypes({T })), // 36 Steel Truck + MW( 1827, 20, 20, 50, MCT_VALUABLES_GOLD_DIAMONDS, LandscapeTypes({T,A,S })), // 37 Armoured Van + MW( 1827, 20, 20, 50, CT_FOOD , LandscapeTypes({ A,S })), // 38 Food Van + MW( 1827, 20, 20, 50, CT_PAPER , LandscapeTypes({ A })), // 39 Paper Truck + MW( 1827, 20, 20, 50, CT_COPPER_ORE , LandscapeTypes({ S })), // 40 Copper Ore Hopper + MW( 1827, 20, 20, 50, CT_WATER , LandscapeTypes({ S })), // 41 Water Tanker + MW( 1827, 20, 20, 50, CT_FRUIT , LandscapeTypes({ S })), // 42 Fruit Truck + MW( 1827, 20, 20, 50, CT_RUBBER , LandscapeTypes({ S })), // 43 Rubber Truck + MW( 1827, 20, 20, 50, CT_SUGAR , LandscapeTypes({ Y})), // 44 Sugar Truck + MW( 1827, 20, 20, 50, CT_COTTON_CANDY, LandscapeTypes({ Y})), // 45 Candyfloss Hopper + MW( 1827, 20, 20, 50, CT_TOFFEE , LandscapeTypes({ Y})), // 46 Toffee Hopper + MW( 1827, 20, 20, 50, CT_BUBBLES , LandscapeTypes({ Y})), // 47 Bubble Van + MW( 1827, 20, 20, 50, CT_COLA , LandscapeTypes({ Y})), // 48 Cola Tanker + MW( 1827, 20, 20, 50, CT_CANDY , LandscapeTypes({ Y})), // 49 Sweet Van + MW( 1827, 20, 20, 50, CT_TOYS , LandscapeTypes({ Y})), // 50 Toy Van + MW( 1827, 20, 20, 50, CT_BATTERIES , LandscapeTypes({ Y})), // 51 Battery Truck + MW( 1827, 20, 20, 50, CT_FIZZY_DRINKS, LandscapeTypes({ Y})), // 52 Fizzy Drink Truck + MW( 1827, 20, 20, 50, CT_PLASTIC , LandscapeTypes({ Y})), // 53 Plastic Truck + MT( 28490, 20, 20, 50, CT_NONE , LandscapeTypes({T,A,S })), // 54 'X2001' (Electric) + MT( 31047, 20, 20, 50, CT_PASSENGERS , LandscapeTypes({T,A,S })), // 55 'Millennium Z1' (Electric) + MT( 28855, 20, 20, 50, CT_NONE , LandscapeTypes({ Y})), // 56 Wizzowow Z99 + MW( 1827, 20, 20, 50, CT_PASSENGERS , LandscapeTypes({T,A,S,Y})), // 57 Passenger Carriage + MW( 1827, 20, 20, 50, CT_MAIL , LandscapeTypes({T,A,S,Y})), // 58 Mail Van + MW( 1827, 20, 20, 50, CT_COAL , LandscapeTypes({T,A })), // 59 Coal Truck + MW( 1827, 20, 20, 50, CT_OIL , LandscapeTypes({T,A,S })), // 60 Oil Tanker + MW( 1827, 20, 20, 50, CT_LIVESTOCK , LandscapeTypes({T,A })), // 61 Livestock Van + MW( 1827, 20, 20, 50, CT_GOODS , LandscapeTypes({T,A,S })), // 62 Goods Van + MW( 1827, 20, 20, 50, MCT_GRAIN_WHEAT_MAIZE, LandscapeTypes({T,A,S })), // 63 Grain Hopper + MW( 1827, 20, 20, 50, CT_WOOD , LandscapeTypes({T,A,S })), // 64 Wood Truck + MW( 1827, 20, 20, 50, CT_IRON_ORE , LandscapeTypes({T })), // 65 Iron Ore Hopper + MW( 1827, 20, 20, 50, CT_STEEL , LandscapeTypes({T })), // 66 Steel Truck + MW( 1827, 20, 20, 50, MCT_VALUABLES_GOLD_DIAMONDS, LandscapeTypes({T,A,S })), // 67 Armoured Van + MW( 1827, 20, 20, 50, CT_FOOD , LandscapeTypes({ A,S })), // 68 Food Van + MW( 1827, 20, 20, 50, CT_PAPER , LandscapeTypes({ A })), // 69 Paper Truck + MW( 1827, 20, 20, 50, CT_COPPER_ORE , LandscapeTypes({ S })), // 70 Copper Ore Hopper + MW( 1827, 20, 20, 50, CT_WATER , LandscapeTypes({ S })), // 71 Water Tanker + MW( 1827, 20, 20, 50, CT_FRUIT , LandscapeTypes({ S })), // 72 Fruit Truck + MW( 1827, 20, 20, 50, CT_RUBBER , LandscapeTypes({ S })), // 73 Rubber Truck + MW( 1827, 20, 20, 50, CT_SUGAR , LandscapeTypes({ Y})), // 74 Sugar Truck + MW( 1827, 20, 20, 50, CT_COTTON_CANDY, LandscapeTypes({ Y})), // 75 Candyfloss Hopper + MW( 1827, 20, 20, 50, CT_TOFFEE , LandscapeTypes({ Y})), // 76 Toffee Hopper + MW( 1827, 20, 20, 50, CT_BUBBLES , LandscapeTypes({ Y})), // 77 Bubble Van + MW( 1827, 20, 20, 50, CT_COLA , LandscapeTypes({ Y})), // 78 Cola Tanker + MW( 1827, 20, 20, 50, CT_CANDY , LandscapeTypes({ Y})), // 79 Sweet Van + MW( 1827, 20, 20, 50, CT_TOYS , LandscapeTypes({ Y})), // 80 Toy Van + MW( 1827, 20, 20, 50, CT_BATTERIES , LandscapeTypes({ Y})), // 81 Battery Truck + MW( 1827, 20, 20, 50, CT_FIZZY_DRINKS, LandscapeTypes({ Y})), // 82 Fizzy Drink Truck + MW( 1827, 20, 20, 50, CT_PLASTIC , LandscapeTypes({ Y})), // 83 Plastic Truck + MT( 36525, 20, 20, 50, CT_NONE , LandscapeTypes({T,A,S })), // 84 Lev1 'Leviathan' (Electric) + MT( 39447, 20, 20, 50, CT_NONE , LandscapeTypes({T,A,S })), // 85 Lev2 'Cyclops' (Electric) + MT( 42004, 20, 20, 50, CT_NONE , LandscapeTypes({T,A,S })), // 86 Lev3 'Pegasus' (Electric) + MT( 42735, 20, 20, 50, CT_NONE , LandscapeTypes({T,A,S })), // 87 Lev4 'Chimaera' (Electric) + MT( 36891, 20, 20, 60, CT_NONE , LandscapeTypes({ Y})), // 88 Wizzowow Rocketeer + MW( 1827, 20, 20, 50, CT_PASSENGERS , LandscapeTypes({T,A,S,Y})), // 89 Passenger Carriage + MW( 1827, 20, 20, 50, CT_MAIL , LandscapeTypes({T,A,S,Y})), // 90 Mail Van + MW( 1827, 20, 20, 50, CT_COAL , LandscapeTypes({T,A })), // 91 Coal Truck + MW( 1827, 20, 20, 50, CT_OIL , LandscapeTypes({T,A,S })), // 92 Oil Tanker + MW( 1827, 20, 20, 50, CT_LIVESTOCK , LandscapeTypes({T,A })), // 93 Livestock Van + MW( 1827, 20, 20, 50, CT_GOODS , LandscapeTypes({T,A,S })), // 94 Goods Van + MW( 1827, 20, 20, 50, MCT_GRAIN_WHEAT_MAIZE, LandscapeTypes({T,A,S })), // 95 Grain Hopper + MW( 1827, 20, 20, 50, CT_WOOD , LandscapeTypes({T,A,S })), // 96 Wood Truck + MW( 1827, 20, 20, 50, CT_IRON_ORE , LandscapeTypes({T })), // 97 Iron Ore Hopper + MW( 1827, 20, 20, 50, CT_STEEL , LandscapeTypes({T })), // 98 Steel Truck + MW( 1827, 20, 20, 50, MCT_VALUABLES_GOLD_DIAMONDS, LandscapeTypes({T,A,S })), // 99 Armoured Van + MW( 1827, 20, 20, 50, CT_FOOD , LandscapeTypes({ A,S })), // 100 Food Van + MW( 1827, 20, 20, 50, CT_PAPER , LandscapeTypes({ A })), // 101 Paper Truck + MW( 1827, 20, 20, 50, CT_COPPER_ORE , LandscapeTypes({ S })), // 102 Copper Ore Hopper + MW( 1827, 20, 20, 50, CT_WATER , LandscapeTypes({ S })), // 103 Water Tanker + MW( 1827, 20, 20, 50, CT_FRUIT , LandscapeTypes({ S })), // 104 Fruit Truck + MW( 1827, 20, 20, 50, CT_RUBBER , LandscapeTypes({ S })), // 105 Rubber Truck + MW( 1827, 20, 20, 50, CT_SUGAR , LandscapeTypes({ Y})), // 106 Sugar Truck + MW( 1827, 20, 20, 50, CT_COTTON_CANDY, LandscapeTypes({ Y})), // 107 Candyfloss Hopper + MW( 1827, 20, 20, 50, CT_TOFFEE , LandscapeTypes({ Y})), // 108 Toffee Hopper + MW( 1827, 20, 20, 50, CT_BUBBLES , LandscapeTypes({ Y})), // 109 Bubble Van + MW( 1827, 20, 20, 50, CT_COLA , LandscapeTypes({ Y})), // 110 Cola Tanker + MW( 1827, 20, 20, 50, CT_CANDY , LandscapeTypes({ Y})), // 111 Sweet Van + MW( 1827, 20, 20, 50, CT_TOYS , LandscapeTypes({ Y})), // 112 Toy Van + MW( 1827, 20, 20, 50, CT_BATTERIES , LandscapeTypes({ Y})), // 113 Battery Truck + MW( 1827, 20, 20, 50, CT_FIZZY_DRINKS, LandscapeTypes({ Y})), // 114 Fizzy Drink Truck + MW( 1827, 20, 20, 50, CT_PLASTIC , LandscapeTypes({ Y})), // 115 Plastic Truck + MR( 3378, 20, 12, 40, CT_PASSENGERS , LandscapeTypes({T,A,S })), // 116 MPS Regal Bus + MR( 16071, 20, 15, 30, CT_PASSENGERS , LandscapeTypes({T,A,S })), // 117 Hereford Leopard Bus + MR( 24107, 20, 15, 40, CT_PASSENGERS , LandscapeTypes({T,A,S })), // 118 Foster Bus + MR( 32142, 20, 15, 80, CT_PASSENGERS , LandscapeTypes({T,A,S })), // 119 Foster MkII Superbus + MR( 9132, 20, 15, 40, CT_PASSENGERS , LandscapeTypes({ Y})), // 120 Ploddyphut MkI Bus + MR( 18993, 20, 15, 40, CT_PASSENGERS , LandscapeTypes({ Y})), // 121 Ploddyphut MkII Bus + MR( 32873, 20, 15, 80, CT_PASSENGERS , LandscapeTypes({ Y})), // 122 Ploddyphut MkIII Bus + MR( 5479, 20, 15, 55, CT_COAL , LandscapeTypes({T,A })), // 123 Balogh Coal Truck + MR( 20089, 20, 15, 55, CT_COAL , LandscapeTypes({T,A })), // 124 Uhl Coal Truck + MR( 33969, 20, 15, 85, CT_COAL , LandscapeTypes({T,A })), // 125 DW Coal Truck + MR( 5479, 20, 15, 55, CT_MAIL , LandscapeTypes({T,A,S })), // 126 MPS Mail Truck + MR( 21550, 20, 15, 55, CT_MAIL , LandscapeTypes({T,A,S })), // 127 Reynard Mail Truck + MR( 35795, 20, 15, 85, CT_MAIL , LandscapeTypes({T,A,S })), // 128 Perry Mail Truck + MR( 5479, 20, 15, 55, CT_MAIL , LandscapeTypes({ Y})), // 129 MightyMover Mail Truck + MR( 21550, 20, 15, 55, CT_MAIL , LandscapeTypes({ Y})), // 130 Powernaught Mail Truck + MR( 35795, 20, 15, 85, CT_MAIL , LandscapeTypes({ Y})), // 131 Wizzowow Mail Truck + MR( 5479, 20, 15, 55, CT_OIL , LandscapeTypes({T,A,S })), // 132 Witcombe Oil Tanker + MR( 19359, 20, 15, 55, CT_OIL , LandscapeTypes({T,A,S })), // 133 Foster Oil Tanker + MR( 31047, 20, 15, 85, CT_OIL , LandscapeTypes({T,A,S })), // 134 Perry Oil Tanker + MR( 5479, 20, 15, 55, CT_LIVESTOCK , LandscapeTypes({T,A })), // 135 Talbott Livestock Van + MR( 21915, 20, 15, 55, CT_LIVESTOCK , LandscapeTypes({T,A })), // 136 Uhl Livestock Van + MR( 37256, 20, 15, 85, CT_LIVESTOCK , LandscapeTypes({T,A })), // 137 Foster Livestock Van + MR( 5479, 20, 15, 55, CT_GOODS , LandscapeTypes({T,A,S })), // 138 Balogh Goods Truck + MR( 19724, 20, 15, 55, CT_GOODS , LandscapeTypes({T,A,S })), // 139 Craighead Goods Truck + MR( 31047, 20, 15, 85, CT_GOODS , LandscapeTypes({T,A,S })), // 140 Goss Goods Truck + MR( 5479, 20, 15, 55, MCT_GRAIN_WHEAT_MAIZE, LandscapeTypes({T,A,S })), // 141 Hereford Grain Truck + MR( 21185, 20, 15, 55, MCT_GRAIN_WHEAT_MAIZE, LandscapeTypes({T,A,S })), // 142 Thomas Grain Truck + MR( 32873, 20, 15, 85, MCT_GRAIN_WHEAT_MAIZE, LandscapeTypes({T,A,S })), // 143 Goss Grain Truck + MR( 5479, 20, 15, 55, CT_WOOD , LandscapeTypes({T,A,S })), // 144 Witcombe Wood Truck + MR( 19724, 20, 15, 55, CT_WOOD , LandscapeTypes({T,A,S })), // 145 Foster Wood Truck + MR( 35430, 20, 15, 85, CT_WOOD , LandscapeTypes({T,A,S })), // 146 Moreland Wood Truck + MR( 5479, 20, 15, 55, CT_IRON_ORE , LandscapeTypes({T })), // 147 MPS Iron Ore Truck + MR( 20820, 20, 15, 55, CT_IRON_ORE , LandscapeTypes({T })), // 148 Uhl Iron Ore Truck + MR( 33238, 20, 15, 85, CT_IRON_ORE , LandscapeTypes({T })), // 149 Chippy Iron Ore Truck + MR( 5479, 20, 15, 55, CT_STEEL , LandscapeTypes({T })), // 150 Balogh Steel Truck + MR( 21185, 20, 15, 55, CT_STEEL , LandscapeTypes({T })), // 151 Uhl Steel Truck + MR( 31777, 20, 15, 85, CT_STEEL , LandscapeTypes({T })), // 152 Kelling Steel Truck + MR( 5479, 20, 15, 55, MCT_VALUABLES_GOLD_DIAMONDS, LandscapeTypes({T,A,S })), // 153 Balogh Armoured Truck + MR( 22281, 20, 15, 55, MCT_VALUABLES_GOLD_DIAMONDS, LandscapeTypes({T,A,S })), // 154 Uhl Armoured Truck + MR( 33603, 20, 15, 85, MCT_VALUABLES_GOLD_DIAMONDS, LandscapeTypes({T,A,S })), // 155 Foster Armoured Truck + MR( 5479, 20, 15, 55, CT_FOOD , LandscapeTypes({ A,S })), // 156 Foster Food Van + MR( 18628, 20, 15, 55, CT_FOOD , LandscapeTypes({ A,S })), // 157 Perry Food Van + MR( 30681, 20, 15, 85, CT_FOOD , LandscapeTypes({ A,S })), // 158 Chippy Food Van + MR( 5479, 20, 15, 55, CT_PAPER , LandscapeTypes({ A })), // 159 Uhl Paper Truck + MR( 21185, 20, 15, 55, CT_PAPER , LandscapeTypes({ A })), // 160 Balogh Paper Truck + MR( 31777, 20, 15, 85, CT_PAPER , LandscapeTypes({ A })), // 161 MPS Paper Truck + MR( 5479, 20, 15, 55, CT_COPPER_ORE , LandscapeTypes({ S })), // 162 MPS Copper Ore Truck + MR( 20820, 20, 15, 55, CT_COPPER_ORE , LandscapeTypes({ S })), // 163 Uhl Copper Ore Truck + MR( 33238, 20, 15, 85, CT_COPPER_ORE , LandscapeTypes({ S })), // 164 Goss Copper Ore Truck + MR( 5479, 20, 15, 55, CT_WATER , LandscapeTypes({ S })), // 165 Uhl Water Tanker + MR( 20970, 20, 15, 55, CT_WATER , LandscapeTypes({ S })), // 166 Balogh Water Tanker + MR( 33388, 20, 15, 85, CT_WATER , LandscapeTypes({ S })), // 167 MPS Water Tanker + MR( 5479, 20, 15, 55, CT_FRUIT , LandscapeTypes({ S })), // 168 Balogh Fruit Truck + MR( 21335, 20, 15, 55, CT_FRUIT , LandscapeTypes({ S })), // 169 Uhl Fruit Truck + MR( 33753, 20, 15, 85, CT_FRUIT , LandscapeTypes({ S })), // 170 Kelling Fruit Truck + MR( 5479, 20, 15, 55, CT_RUBBER , LandscapeTypes({ S })), // 171 Balogh Rubber Truck + MR( 20604, 20, 15, 55, CT_RUBBER , LandscapeTypes({ S })), // 172 Uhl Rubber Truck + MR( 33023, 20, 15, 85, CT_RUBBER , LandscapeTypes({ S })), // 173 RMT Rubber Truck + MR( 5479, 20, 15, 55, CT_SUGAR , LandscapeTypes({ Y})), // 174 MightyMover Sugar Truck + MR( 19724, 20, 15, 55, CT_SUGAR , LandscapeTypes({ Y})), // 175 Powernaught Sugar Truck + MR( 33238, 20, 15, 85, CT_SUGAR , LandscapeTypes({ Y})), // 176 Wizzowow Sugar Truck + MR( 5479, 20, 15, 55, CT_COLA , LandscapeTypes({ Y})), // 177 MightyMover Cola Truck + MR( 20089, 20, 15, 55, CT_COLA , LandscapeTypes({ Y})), // 178 Powernaught Cola Truck + MR( 33603, 20, 15, 85, CT_COLA , LandscapeTypes({ Y})), // 179 Wizzowow Cola Truck + MR( 5479, 20, 15, 55, CT_COTTON_CANDY, LandscapeTypes({ Y})), // 180 MightyMover Candyfloss Truck + MR( 20454, 20, 15, 55, CT_COTTON_CANDY, LandscapeTypes({ Y})), // 181 Powernaught Candyfloss Truck + MR( 33969, 20, 15, 85, CT_COTTON_CANDY, LandscapeTypes({ Y})), // 182 Wizzowow Candyfloss Truck + MR( 5479, 20, 15, 55, CT_TOFFEE , LandscapeTypes({ Y})), // 183 MightyMover Toffee Truck + MR( 20820, 20, 15, 55, CT_TOFFEE , LandscapeTypes({ Y})), // 184 Powernaught Toffee Truck + MR( 34334, 20, 15, 85, CT_TOFFEE , LandscapeTypes({ Y})), // 185 Wizzowow Toffee Truck + MR( 5479, 20, 15, 55, CT_TOYS , LandscapeTypes({ Y})), // 186 MightyMover Toy Van + MR( 21185, 20, 15, 55, CT_TOYS , LandscapeTypes({ Y})), // 187 Powernaught Toy Van + MR( 34699, 20, 15, 85, CT_TOYS , LandscapeTypes({ Y})), // 188 Wizzowow Toy Van + MR( 5479, 20, 15, 55, CT_CANDY , LandscapeTypes({ Y})), // 189 MightyMover Sweet Truck + MR( 21550, 20, 15, 55, CT_CANDY , LandscapeTypes({ Y})), // 190 Powernaught Sweet Truck + MR( 35064, 20, 15, 85, CT_CANDY , LandscapeTypes({ Y})), // 191 Wizzowow Sweet Truck + MR( 5479, 20, 15, 55, CT_BATTERIES , LandscapeTypes({ Y})), // 192 MightyMover Battery Truck + MR( 19874, 20, 15, 55, CT_BATTERIES , LandscapeTypes({ Y})), // 193 Powernaught Battery Truck + MR( 35430, 20, 15, 85, CT_BATTERIES , LandscapeTypes({ Y})), // 194 Wizzowow Battery Truck + MR( 5479, 20, 15, 55, CT_FIZZY_DRINKS, LandscapeTypes({ Y})), // 195 MightyMover Fizzy Drink Truck + MR( 20239, 20, 15, 55, CT_FIZZY_DRINKS, LandscapeTypes({ Y})), // 196 Powernaught Fizzy Drink Truck + MR( 35795, 20, 15, 85, CT_FIZZY_DRINKS, LandscapeTypes({ Y})), // 197 Wizzowow Fizzy Drink Truck + MR( 5479, 20, 15, 55, CT_PLASTIC , LandscapeTypes({ Y})), // 198 MightyMover Plastic Truck + MR( 20604, 20, 15, 55, CT_PLASTIC , LandscapeTypes({ Y})), // 199 Powernaught Plastic Truck + MR( 32873, 20, 15, 85, CT_PLASTIC , LandscapeTypes({ Y})), // 200 Wizzowow Plastic Truck + MR( 5479, 20, 15, 55, CT_BUBBLES , LandscapeTypes({ Y})), // 201 MightyMover Bubble Truck + MR( 20970, 20, 15, 55, CT_BUBBLES , LandscapeTypes({ Y})), // 202 Powernaught Bubble Truck + MR( 33023, 20, 15, 85, CT_BUBBLES , LandscapeTypes({ Y})), // 203 Wizzowow Bubble Truck + MS( 2922, 5, 30, 50, CT_OIL , LandscapeTypes({T,A,S })), // 204 MPS Oil Tanker + MS( 17167, 5, 30, 90, CT_OIL , LandscapeTypes({T,A,S })), // 205 CS-Inc. Oil Tanker + MS( 2192, 5, 30, 55, CT_PASSENGERS , LandscapeTypes({T,A,S })), // 206 MPS Passenger Ferry + MS( 18628, 5, 30, 90, CT_PASSENGERS , LandscapeTypes({T,A,S })), // 207 FFP Passenger Ferry + MS( 17257, 10, 25, 90, CT_PASSENGERS , LandscapeTypes({T,A,S })), // 208 Bakewell 300 Hovercraft + MS( 9587, 5, 30, 40, CT_PASSENGERS , LandscapeTypes({ Y})), // 209 Chugger-Chug Passenger Ferry + MS( 20544, 5, 30, 90, CT_PASSENGERS , LandscapeTypes({ Y})), // 210 Shivershake Passenger Ferry + MS( 2557, 5, 30, 55, CT_GOODS , LandscapeTypes({T,A,S })), // 211 Yate Cargo ship + MS( 19724, 5, 30, 98, CT_GOODS , LandscapeTypes({T,A,S })), // 212 Bakewell Cargo ship + MS( 9587, 5, 30, 45, CT_GOODS , LandscapeTypes({ Y})), // 213 Mightymover Cargo ship + MS( 22371, 5, 30, 90, CT_GOODS , LandscapeTypes({ Y})), // 214 Powernaut Cargo ship + MA( 2922, 20, 20, 20, LandscapeTypes({T,A,S })), // 215 Sampson U52 + MA( 9922, 20, 24, 20, LandscapeTypes({T,A,S })), // 216 Coleman Count + MA( 12659, 20, 18, 20, LandscapeTypes({T,A,S })), // 217 FFP Dart + MA( 17652, 20, 25, 35, LandscapeTypes({T,A,S })), // 218 Yate Haugan + MA( 4929, 20, 30, 30, LandscapeTypes({T,A,S })), // 219 Bakewell Cotswald LB-3 + MA( 13695, 20, 23, 25, LandscapeTypes({T,A,S })), // 220 Bakewell Luckett LB-8 + MA( 16341, 20, 26, 30, LandscapeTypes({T,A,S })), // 221 Bakewell Luckett LB-9 + MA( 21395, 20, 25, 30, LandscapeTypes({T,A,S })), // 222 Bakewell Luckett LB80 + MA( 18263, 20, 20, 30, LandscapeTypes({T,A,S })), // 223 Bakewell Luckett LB-10 + MA( 25233, 20, 25, 30, LandscapeTypes({T,A,S })), // 224 Bakewell Luckett LB-11 + MA( 15371, 20, 22, 25, LandscapeTypes({T,A,S })), // 225 Yate Aerospace YAC 1-11 + MA( 15461, 20, 25, 25, LandscapeTypes({T,A,S })), // 226 Darwin 100 + MA( 16952, 20, 22, 25, LandscapeTypes({T,A,S })), // 227 Darwin 200 + MA( 17227, 20, 25, 30, LandscapeTypes({T,A,S })), // 228 Darwin 300 + MA( 22371, 20, 25, 35, LandscapeTypes({T,A,S })), // 229 Darwin 400 + MA( 22341, 20, 25, 30, LandscapeTypes({T,A,S })), // 230 Darwin 500 + MA( 27209, 20, 25, 30, LandscapeTypes({T,A,S })), // 231 Darwin 600 + MA( 17988, 20, 20, 30, LandscapeTypes({T,A,S })), // 232 Guru Galaxy + MA( 18993, 20, 24, 35, LandscapeTypes({T,A,S })), // 233 Airtaxi A21 + MA( 22401, 20, 24, 30, LandscapeTypes({T,A,S })), // 234 Airtaxi A31 + MA( 24472, 20, 24, 30, LandscapeTypes({T,A,S })), // 235 Airtaxi A32 + MA( 26724, 20, 24, 30, LandscapeTypes({T,A,S })), // 236 Airtaxi A33 + MA( 22005, 20, 25, 30, LandscapeTypes({T,A,S })), // 237 Yate Aerospace YAe46 + MA( 24107, 20, 20, 35, LandscapeTypes({T,A,S })), // 238 Dinger 100 + MA( 29310, 20, 25, 60, LandscapeTypes({T,A,S })), // 239 AirTaxi A34-1000 + MA( 35520, 20, 22, 30, LandscapeTypes({T,A,S })), // 240 Yate Z-Shuttle + MA( 36981, 20, 22, 30, LandscapeTypes({T,A,S })), // 241 Kelling K1 + MA( 38807, 20, 22, 50, LandscapeTypes({T,A,S })), // 242 Kelling K6 + MA( 42094, 20, 25, 30, LandscapeTypes({T,A,S })), // 243 Kelling K7 + MA( 44651, 20, 23, 30, LandscapeTypes({T,A,S })), // 244 Darwin 700 + MA( 40268, 20, 25, 30, LandscapeTypes({T,A,S })), // 245 FFP Hyperdart 2 + MA( 33693, 20, 25, 50, LandscapeTypes({T,A,S })), // 246 Dinger 200 + MA( 32963, 20, 20, 60, LandscapeTypes({T,A,S })), // 247 Dinger 1000 + MA( 9222, 20, 20, 35, LandscapeTypes({ Y})), // 248 Ploddyphut 100 + MA( 12874, 20, 20, 35, LandscapeTypes({ Y})), // 249 Ploddyphut 500 + MA( 16892, 20, 20, 35, LandscapeTypes({ Y})), // 250 Flashbang X1 + MA( 21275, 20, 20, 99, LandscapeTypes({ Y})), // 251 Juggerplane M1 + MA( 23832, 20, 20, 99, LandscapeTypes({ Y})), // 252 Flashbang Wizzer + MA( 13575, 20, 20, 40, LandscapeTypes({T,A,S })), // 253 Tricario Helicopter + MA( 28215, 20, 20, 30, LandscapeTypes({T,A,S })), // 254 Guru X2 Helicopter + MA( 13575, 20, 20, 99, LandscapeTypes({ Y})), // 255 Powernaut Helicopter }; #undef Y #undef S diff --git a/src/table/object_land.h b/src/table/object_land.h index 24b3ee8c31..23856ee961 100644 --- a/src/table/object_land.h +++ b/src/table/object_land.h @@ -128,17 +128,17 @@ static const DrawTileSprites _object_hq[] = { * A = Sub-Arctic * S = Sub-Tropic * Y = Toyland */ -#define T 1 -#define A 2 -#define S 4 -#define Y 8 +#define T LandscapeType::Temperate +#define A LandscapeType::Arctic +#define S LandscapeType::Tropic +#define Y LandscapeType::Toyland /** Specification of the original object structures. */ extern const ObjectSpec _original_objects[] = { - M(STR_LAI_OBJECT_DESCRIPTION_TRANSMITTER, 0x11, 0, 0, 10, T|A|S , 15, OBJECT_FLAG_CANNOT_REMOVE | OBJECT_FLAG_ONLY_IN_SCENEDIT), - M(STR_LAI_OBJECT_DESCRIPTION_LIGHTHOUSE, 0x11, 0, 0, 8, T|A , 8, OBJECT_FLAG_CANNOT_REMOVE | OBJECT_FLAG_ONLY_IN_SCENEDIT | OBJECT_FLAG_SCALE_BY_WATER), - M(STR_TOWN_BUILDING_NAME_STATUE_1, 0x11, 0, 0, 5, T|S|A|Y, 0, OBJECT_FLAG_CANNOT_REMOVE | OBJECT_FLAG_ONLY_IN_GAME | OBJECT_FLAG_ONLY_IN_SCENEDIT), // Yes, we disallow building this everywhere. Happens in "special" case! - M(STR_LAI_OBJECT_DESCRIPTION_COMPANY_OWNED_LAND, 0x11, 10, 10, 0, T|S|A|Y, 0, OBJECT_FLAG_AUTOREMOVE | OBJECT_FLAG_ONLY_IN_GAME | OBJECT_FLAG_CLEAR_INCOME | OBJECT_FLAG_HAS_NO_FOUNDATION ), // Only non-silly use case is to use it when you cannot build a station, so disallow bridges - M(STR_LAI_OBJECT_DESCRIPTION_COMPANY_HEADQUARTERS, 0x22, 0, 0, 7, T|S|A|Y, 0, OBJECT_FLAG_CANNOT_REMOVE | OBJECT_FLAG_ONLY_IN_GAME), + M(STR_LAI_OBJECT_DESCRIPTION_TRANSMITTER, 0x11, 0, 0, 10, LandscapeTypes({T,A,S }), 15, OBJECT_FLAG_CANNOT_REMOVE | OBJECT_FLAG_ONLY_IN_SCENEDIT), + M(STR_LAI_OBJECT_DESCRIPTION_LIGHTHOUSE, 0x11, 0, 0, 8, LandscapeTypes({T,A }), 8, OBJECT_FLAG_CANNOT_REMOVE | OBJECT_FLAG_ONLY_IN_SCENEDIT | OBJECT_FLAG_SCALE_BY_WATER), + M(STR_TOWN_BUILDING_NAME_STATUE_1, 0x11, 0, 0, 5, LandscapeTypes({T,S,A,Y}), 0, OBJECT_FLAG_CANNOT_REMOVE | OBJECT_FLAG_ONLY_IN_GAME | OBJECT_FLAG_ONLY_IN_SCENEDIT), // Yes, we disallow building this everywhere. Happens in "special" case! + M(STR_LAI_OBJECT_DESCRIPTION_COMPANY_OWNED_LAND, 0x11, 10, 10, 0, LandscapeTypes({T,S,A,Y}), 0, OBJECT_FLAG_AUTOREMOVE | OBJECT_FLAG_ONLY_IN_GAME | OBJECT_FLAG_CLEAR_INCOME | OBJECT_FLAG_HAS_NO_FOUNDATION ), // Only non-silly use case is to use it when you cannot build a station, so disallow bridges + M(STR_LAI_OBJECT_DESCRIPTION_COMPANY_HEADQUARTERS, 0x22, 0, 0, 7, LandscapeTypes({T,S,A,Y}), 0, OBJECT_FLAG_CANNOT_REMOVE | OBJECT_FLAG_ONLY_IN_GAME), }; #undef M diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index 21cb3062e3..ce8eebc8e8 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -540,7 +540,7 @@ struct ScenarioEditorLandscapeGenerationWindow : Window { { this->CreateNestedTree(); NWidgetStacked *show_desert = this->GetWidget(WID_ETT_SHOW_PLACE_DESERT); - show_desert->SetDisplayedPlane(_settings_game.game_creation.landscape == LT_TROPIC ? 0 : SZSP_NONE); + show_desert->SetDisplayedPlane(_settings_game.game_creation.landscape == LandscapeType::Tropic ? 0 : SZSP_NONE); this->FinishInitNested(window_number); this->last_user_action = INVALID_WID_ETT; } diff --git a/src/tgp.cpp b/src/tgp.cpp index 8a365702a2..cfe88cfe09 100644 --- a/src/tgp.cpp +++ b/src/tgp.cpp @@ -471,8 +471,8 @@ static void HeightMapSineTransform(Height h_min, Height h_max) fheight = (double)(h - h_min) / (double)(h_max - h_min); /* Apply sine transform depending on landscape type */ switch (_settings_game.game_creation.landscape) { - case LT_TOYLAND: - case LT_TEMPERATE: + case LandscapeType::Toyland: + case LandscapeType::Temperate: /* Move and scale 0..1 into -1..+1 */ fheight = 2 * fheight - 1; /* Sine transform */ @@ -481,7 +481,7 @@ static void HeightMapSineTransform(Height h_min, Height h_max) fheight = 0.5 * (fheight + 1); break; - case LT_ARCTIC: + case LandscapeType::Arctic: { /* Arctic terrain needs special height distribution. * Redistribute heights to have more tiles at highest (75%..100%) range */ @@ -502,7 +502,7 @@ static void HeightMapSineTransform(Height h_min, Height h_max) } break; - case LT_TROPIC: + case LandscapeType::Tropic: { /* Desert terrain needs special height distribution. * Half of tiles should be at lowest (0..25%) heights */ diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 11dd675b5c..ac93a538ef 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -830,7 +830,7 @@ void AddAcceptedCargoOfHouse(TileIndex tile, HouseID house, const HouseSpec *hs, if (callback != CALLBACK_FAILED) { AddAcceptedCargoSetMask(accepts[0], GB(callback, 0, 4), acceptance, always_accepted); AddAcceptedCargoSetMask(accepts[1], GB(callback, 4, 4), acceptance, always_accepted); - if (_settings_game.game_creation.landscape != LT_TEMPERATE && HasBit(callback, 12)) { + if (_settings_game.game_creation.landscape != LandscapeType::Temperate && HasBit(callback, 12)) { /* The 'S' bit indicates food instead of goods */ AddAcceptedCargoSetMask(GetCargoTypeByLabel(CT_FOOD), GB(callback, 8, 4), acceptance, always_accepted); } else { @@ -2042,14 +2042,17 @@ static void DoCreateTown(Town *t, TileIndex tile, uint32_t townnameparts, TownSi /* Set the default cargo requirement for town growth */ switch (_settings_game.game_creation.landscape) { - case LT_ARCTIC: + case LandscapeType::Arctic: if (FindFirstCargoWithTownAcceptanceEffect(TAE_FOOD) != nullptr) t->goal[TAE_FOOD] = TOWN_GROWTH_WINTER; break; - case LT_TROPIC: + case LandscapeType::Tropic: if (FindFirstCargoWithTownAcceptanceEffect(TAE_FOOD) != nullptr) t->goal[TAE_FOOD] = TOWN_GROWTH_DESERT; if (FindFirstCargoWithTownAcceptanceEffect(TAE_WATER) != nullptr) t->goal[TAE_WATER] = TOWN_GROWTH_DESERT; break; + + default: + break; } t->fund_buildings_months = 0; @@ -2777,8 +2780,8 @@ static bool TryBuildTownHouse(Town *t, TileIndex tile) HouseZonesBits rad = GetTownRadiusGroup(t, tile); /* Above snow? */ - int land = _settings_game.game_creation.landscape; - if (land == LT_ARCTIC && maxz > HighestSnowLine()) land = -1; + int land = to_underlying(_settings_game.game_creation.landscape); + if (_settings_game.game_creation.landscape == LandscapeType::Arctic && maxz > HighestSnowLine()) land = -1; uint bitmask = (1 << rad) + (1 << (land + 12)); diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 20482c88a5..ab9903825d 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -1483,10 +1483,10 @@ public: void SetClimateMask() { switch (_settings_game.game_creation.landscape) { - case LT_TEMPERATE: this->climate_mask = HZ_TEMP; break; - case LT_ARCTIC: this->climate_mask = HZ_SUBARTC_ABOVE | HZ_SUBARTC_BELOW; break; - case LT_TROPIC: this->climate_mask = HZ_SUBTROPIC; break; - case LT_TOYLAND: this->climate_mask = HZ_TOYLND; break; + case LandscapeType::Temperate: this->climate_mask = HZ_TEMP; break; + case LandscapeType::Arctic: this->climate_mask = HZ_SUBARTC_ABOVE | HZ_SUBARTC_BELOW; break; + case LandscapeType::Tropic: this->climate_mask = HZ_SUBTROPIC; break; + case LandscapeType::Toyland: this->climate_mask = HZ_TOYLND; break; default: NOT_REACHED(); } diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp index a5672ff5eb..6877e7e2e5 100644 --- a/src/tree_cmd.cpp +++ b/src/tree_cmd.cpp @@ -135,13 +135,13 @@ static void PlantTreesOnTile(TileIndex tile, TreeType treetype, uint count, Tree static TreeType GetRandomTreeType(TileIndex tile, uint seed) { switch (_settings_game.game_creation.landscape) { - case LT_TEMPERATE: + case LandscapeType::Temperate: return static_cast(seed * TREE_COUNT_TEMPERATE / 256 + TREE_TEMPERATE); - case LT_ARCTIC: + case LandscapeType::Arctic: return static_cast(seed * TREE_COUNT_SUB_ARCTIC / 256 + TREE_SUB_ARCTIC); - case LT_TROPIC: + case LandscapeType::Tropic: switch (GetTropicZone(tile)) { case TROPICZONE_NORMAL: return static_cast(seed * TREE_COUNT_SUB_TROPICAL / 256 + TREE_SUB_TROPICAL); case TROPICZONE_DESERT: return static_cast((seed > 12) ? TREE_INVALID : TREE_CACTUS); @@ -267,7 +267,7 @@ void PlaceTreesRandomly() /* The higher we get, the more trees we plant */ j = GetTileZ(tile) * 2; /* Above snowline more trees! */ - if (_settings_game.game_creation.landscape == LT_ARCTIC && ht > GetSnowLine()) j *= 3; + if (_settings_game.game_creation.landscape == LandscapeType::Arctic && ht > GetSnowLine()) j *= 3; while (j--) { PlaceTreeAtSameHeight(tile, ht); } @@ -275,7 +275,7 @@ void PlaceTreesRandomly() } while (--i); /* place extra trees at rainforest area */ - if (_settings_game.game_creation.landscape == LT_TROPIC) { + if (_settings_game.game_creation.landscape == LandscapeType::Tropic) { i = Map::ScaleBySize(DEFAULT_RAINFOREST_TREE_STEPS); if (_game_mode == GM_EDITOR) i /= EDITOR_TREE_DIV; @@ -358,15 +358,15 @@ void GenerateTrees() if (_settings_game.game_creation.tree_placer == TP_NONE) return; switch (_settings_game.game_creation.tree_placer) { - case TP_ORIGINAL: i = _settings_game.game_creation.landscape == LT_ARCTIC ? 15 : 6; break; - case TP_IMPROVED: i = _settings_game.game_creation.landscape == LT_ARCTIC ? 4 : 2; break; + case TP_ORIGINAL: i = _settings_game.game_creation.landscape == LandscapeType::Arctic ? 15 : 6; break; + case TP_IMPROVED: i = _settings_game.game_creation.landscape == LandscapeType::Arctic ? 4 : 2; break; default: NOT_REACHED(); } total = Map::ScaleBySize(DEFAULT_TREE_STEPS); - if (_settings_game.game_creation.landscape == LT_TROPIC) total += Map::ScaleBySize(DEFAULT_RAINFOREST_TREE_STEPS); + if (_settings_game.game_creation.landscape == LandscapeType::Tropic) total += Map::ScaleBySize(DEFAULT_RAINFOREST_TREE_STEPS); total *= i; - uint num_groups = (_settings_game.game_creation.landscape != LT_TOYLAND) ? Map::ScaleBySize(GB(Random(), 0, 5) + 25) : 0; + uint num_groups = (_settings_game.game_creation.landscape != LandscapeType::Toyland) ? Map::ScaleBySize(GB(Random(), 0, 5) + 25) : 0; total += num_groups * DEFAULT_TREE_STEPS; SetGeneratingWorldProgress(GWP_TREE, total); @@ -393,7 +393,7 @@ CommandCost CmdPlantTree(DoCommandFlag flags, TileIndex tile, TileIndex start_ti if (start_tile >= Map::Size()) return CMD_ERROR; /* Check the tree type within the current climate */ - if (tree_to_plant != TREE_INVALID && !IsInsideBS(tree_to_plant, _tree_base_by_landscape[_settings_game.game_creation.landscape], _tree_count_by_landscape[_settings_game.game_creation.landscape])) return CMD_ERROR; + if (tree_to_plant != TREE_INVALID && !IsInsideBS(tree_to_plant, _tree_base_by_landscape[to_underlying(_settings_game.game_creation.landscape)], _tree_count_by_landscape[to_underlying(_settings_game.game_creation.landscape)])) return CMD_ERROR; Company *c = (_game_mode != GM_EDITOR) ? Company::GetIfValid(_current_company) : nullptr; int limit = (c == nullptr ? INT32_MAX : GB(c->tree_limit, 16, 16)); @@ -439,7 +439,7 @@ CommandCost CmdPlantTree(DoCommandFlag flags, TileIndex tile, TileIndex start_ti TreeType treetype = (TreeType)tree_to_plant; /* Be a bit picky about which trees go where. */ - if (_settings_game.game_creation.landscape == LT_TROPIC && treetype != TREE_INVALID && ( + if (_settings_game.game_creation.landscape == LandscapeType::Tropic && treetype != TREE_INVALID && ( /* No cacti outside the desert */ (treetype == TREE_CACTUS && GetTropicZone(current_tile) != TROPICZONE_DESERT) || /* No rain forest trees outside the rain forest, except in the editor mode where it makes those tiles rain forest tile */ @@ -689,7 +689,7 @@ static void TileLoopTreesAlps(TileIndex tile) static bool CanPlantExtraTrees(TileIndex tile) { - return ((_settings_game.game_creation.landscape == LT_TROPIC && GetTropicZone(tile) == TROPICZONE_RAINFOREST) ? + return ((_settings_game.game_creation.landscape == LandscapeType::Tropic && GetTropicZone(tile) == TROPICZONE_RAINFOREST) ? (_settings_game.construction.extra_tree_placement == ETP_SPREAD_ALL || _settings_game.construction.extra_tree_placement == ETP_SPREAD_RAINFOREST) : _settings_game.construction.extra_tree_placement == ETP_SPREAD_ALL); } @@ -700,8 +700,9 @@ static void TileLoop_Trees(TileIndex tile) TileLoop_Water(tile); } else { switch (_settings_game.game_creation.landscape) { - case LT_TROPIC: TileLoopTreesDesert(tile); break; - case LT_ARCTIC: TileLoopTreesAlps(tile); break; + case LandscapeType::Tropic: TileLoopTreesDesert(tile); break; + case LandscapeType::Arctic: TileLoopTreesAlps(tile); break; + default: break; } } @@ -729,7 +730,7 @@ static void TileLoop_Trees(TileIndex tile) switch (GetTreeGrowth(tile)) { case TreeGrowthStage::Grown: // regular sized tree - if (_settings_game.game_creation.landscape == LT_TROPIC && + if (_settings_game.game_creation.landscape == LandscapeType::Tropic && GetTreeType(tile) != TREE_CACTUS && GetTropicZone(tile) == TROPICZONE_DESERT) { AddTreeGrowth(tile, 1); @@ -792,7 +793,7 @@ static void TileLoop_Trees(TileIndex tile) break; } default: // snow or desert - if (_settings_game.game_creation.landscape == LT_TROPIC) { + if (_settings_game.game_creation.landscape == LandscapeType::Tropic) { MakeClear(tile, CLEAR_DESERT, GetTreeDensity(tile)); } else { uint density = GetTreeDensity(tile); @@ -859,7 +860,7 @@ void OnTick_Trees() if (skip < 16 && (TimerGameTick::counter & (16 / skip - 1)) != 0) return; /* place a tree at a random rainforest spot */ - if (_settings_game.game_creation.landscape == LT_TROPIC) { + if (_settings_game.game_creation.landscape == LandscapeType::Tropic) { for (uint c = Map::ScaleBySize(1); c > 0; c--) { PlantRandomTree(true); } diff --git a/src/tree_gui.cpp b/src/tree_gui.cpp index 74c2842d22..d09c97235a 100644 --- a/src/tree_gui.cpp +++ b/src/tree_gui.cpp @@ -52,8 +52,8 @@ const PalSpriteID tree_sprites[] = { */ static Dimension GetMaxTreeSpriteSize() { - const uint16_t base = _tree_base_by_landscape[_settings_game.game_creation.landscape]; - const uint16_t count = _tree_count_by_landscape[_settings_game.game_creation.landscape]; + const uint16_t base = _tree_base_by_landscape[to_underlying(_settings_game.game_creation.landscape)]; + const uint16_t count = _tree_count_by_landscape[to_underlying(_settings_game.game_creation.landscape)]; Dimension size, this_size; Point offset; @@ -130,7 +130,7 @@ class BuildTreesWindow : public Window { TreeType treetype = (TreeType)this->tree_to_plant; if (this->tree_to_plant == TREE_INVALID) { - treetype = (TreeType)(InteractiveRandomRange(_tree_count_by_landscape[_settings_game.game_creation.landscape]) + _tree_base_by_landscape[_settings_game.game_creation.landscape]); + treetype = (TreeType)(InteractiveRandomRange(_tree_count_by_landscape[to_underlying(_settings_game.game_creation.landscape)]) + _tree_base_by_landscape[to_underlying(_settings_game.game_creation.landscape)]); } const uint radius = this->mode == PM_FOREST_LG ? 12 : 5; const uint count = this->mode == PM_FOREST_LG ? 12 : 5; @@ -258,8 +258,8 @@ public: */ static std::unique_ptr MakeTreeTypeButtons() { - const uint8_t type_base = _tree_base_by_landscape[_settings_game.game_creation.landscape]; - const uint8_t type_count = _tree_count_by_landscape[_settings_game.game_creation.landscape]; + const uint8_t type_base = _tree_base_by_landscape[to_underlying(_settings_game.game_creation.landscape)]; + const uint8_t type_count = _tree_count_by_landscape[to_underlying(_settings_game.game_creation.landscape)]; /* Toyland has 9 tree types, which look better in 3x3 than 4x3 */ const int num_columns = type_count == 9 ? 3 : 4; diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp index 9ccf76e95c..22bbcfe91c 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -1768,7 +1768,7 @@ static void TileLoop_TunnelBridge(TileIndex tile) { bool snow_or_desert = HasTunnelBridgeSnowOrDesert(tile); switch (_settings_game.game_creation.landscape) { - case LT_ARCTIC: { + case LandscapeType::Arctic: { /* As long as we do not have a snow density, we want to use the density * from the entry edge. For tunnels this is the lowest point for bridges the highest point. * (Independent of foundations) */ @@ -1780,7 +1780,7 @@ static void TileLoop_TunnelBridge(TileIndex tile) break; } - case LT_TROPIC: + case LandscapeType::Tropic: if (GetTropicZone(tile) == TROPICZONE_DESERT && !snow_or_desert) { SetTunnelBridgeSnowOrDesert(tile, true); MarkTileDirtyByTile(tile); diff --git a/src/vehicle.cpp b/src/vehicle.cpp index b3861dbc58..40bb5bc0da 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1386,7 +1386,7 @@ bool Vehicle::HandleBreakdown() if (!PlayVehicleSound(this, VSE_BREAKDOWN)) { bool train_or_ship = this->type == VEH_TRAIN || this->type == VEH_SHIP; - SndPlayVehicleFx((_settings_game.game_creation.landscape != LT_TOYLAND) ? + SndPlayVehicleFx((_settings_game.game_creation.landscape != LandscapeType::Toyland) ? (train_or_ship ? SND_10_BREAKDOWN_TRAIN_SHIP : SND_0F_BREAKDOWN_ROADVEHICLE) : (train_or_ship ? SND_3A_BREAKDOWN_TRAIN_SHIP_TOYLAND : SND_35_BREAKDOWN_ROADVEHICLE_TOYLAND), this); }