aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/map/Province.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2023-10-28 11:39:08 +0200
committer hop311 <hop3114@gmail.com>2023-10-29 20:42:47 +0100
commit164264b047921dbe1567d2af183e1cffb200a8cb (patch)
tree21c3c81f65ac3259db4808ebe9fd32a94ca993af /src/openvic-simulation/map/Province.cpp
parentd8ec90f07342876e9331819bd3cc372050f78248 (diff)
Astyle formatting (with manual cleanup)
Diffstat (limited to 'src/openvic-simulation/map/Province.cpp')
-rw-r--r--src/openvic-simulation/map/Province.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/openvic-simulation/map/Province.cpp b/src/openvic-simulation/map/Province.cpp
index 45b3987..5a7625f 100644
--- a/src/openvic-simulation/map/Province.cpp
+++ b/src/openvic-simulation/map/Province.cpp
@@ -76,7 +76,9 @@ void Province::reset_buildings() {
bool Province::expand_building(std::string_view building_type_identifier) {
BuildingInstance* building = buildings.get_item_by_identifier(building_type_identifier);
- if (building == nullptr) return false;
+ if (building == nullptr) {
+ return false;
+ }
return building->expand();
}
@@ -154,14 +156,16 @@ void Province::update_pops() {
}
void Province::update_state(Date const& today) {
- for (BuildingInstance& building : buildings.get_items())
+ for (BuildingInstance& building : buildings.get_items()) {
building.update_state(today);
+ }
update_pops();
}
void Province::tick(Date const& today) {
- for (BuildingInstance& building : buildings.get_items())
+ for (BuildingInstance& building : buildings.get_items()) {
building.tick(today);
+ }
}
Province::adjacency_t::adjacency_t(Province const* province, distance_t distance, flags_t flags)
@@ -179,8 +183,9 @@ Province::flags_t Province::adjacency_t::get_flags() const {
bool Province::is_adjacent_to(Province const* province) {
for (adjacency_t adj : adjacencies)
- if (adj.province == province)
+ if (adj.province == province) {
return true;
+ }
return false;
}
@@ -190,8 +195,9 @@ bool Province::add_adjacency(Province const* province, distance_t distance, flag
return false;
}
- if (is_adjacent_to(province))
+ if (is_adjacent_to(province)) {
return false;
+ }
adjacencies.push_back({ province, distance, flags });
return true;
}
@@ -201,5 +207,5 @@ std::vector<Province::adjacency_t> const& Province::get_adjacencies() const {
}
void Province::_set_terrain_type(TerrainType const* type) {
- terrain_type = type;
+ terrain_type = type;
}