diff options
author | Hop311 <Hop3114@gmail.com> | 2023-09-28 20:51:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-28 20:51:56 +0200 |
commit | ae0be2a8d2e1b717f6c4a4617096f17089ce8701 (patch) | |
tree | 897742b074547e4d1694ddff1f4e9e8f14d82d6a /src/openvic-simulation/GameManager.cpp | |
parent | d21255b2ca2fe6cea7f41e88fbb22d138bac74eb (diff) | |
parent | c541a249247b7fe3bdd4c62bce6638e875790f8a (diff) |
Merge pull request #37 from OpenVicProject/dataloading-buildings
Dataloading buildings
Diffstat (limited to 'src/openvic-simulation/GameManager.cpp')
-rw-r--r-- | src/openvic-simulation/GameManager.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/openvic-simulation/GameManager.cpp b/src/openvic-simulation/GameManager.cpp index d9dc3d9..958049d 100644 --- a/src/openvic-simulation/GameManager.cpp +++ b/src/openvic-simulation/GameManager.cpp @@ -177,12 +177,12 @@ bool GameManager::load_hardcoded_defines() { } }, { "mapmode_infrastructure", [](Map const& map, Province const& province) -> colour_t { - Building const* railroad = province.get_building_by_identifier("building_railroad"); + BuildingInstance const* railroad = province.get_building_by_identifier("building_railroad"); if (railroad != nullptr) { - colour_t val = fraction_to_colour_byte(railroad->get_level(), railroad->get_type().get_max_level() + 1, 0.5f, 1.0f); + colour_t val = fraction_to_colour_byte(railroad->get_current_level(), railroad->get_building().get_max_level() + 1, 0.5f, 1.0f); switch (railroad->get_expansion_state()) { - case Building::ExpansionState::CannotExpand: val <<= 16; break; - case Building::ExpansionState::CanExpand: break; + case ExpansionState::CannotExpand: val <<= 16; break; + case ExpansionState::CanExpand: break; default: val <<= 8; break; } return HIGH_ALPHA_VALUE | val; @@ -208,13 +208,5 @@ bool GameManager::load_hardcoded_defines() { ret &= map.add_mapmode(mapmode.first, mapmode.second); map.lock_mapmodes(); - using building_type_t = std::tuple<std::string, Building::level_t, Timespan>; - const std::vector<building_type_t> building_types { - { "building_fort", 4, 8 }, { "building_naval_base", 6, 15 }, { "building_railroad", 5, 10 } // Move this to building.hpp - }; - for (building_type_t const& type : building_types) - ret &= building_manager.add_building_type(std::get<0>(type), std::get<1>(type), std::get<2>(type)); - building_manager.lock_building_types(); - return ret; } |