|
1 | 1 | #include "ResourceGatheringOperation.hpp" |
2 | 2 |
|
| 3 | +#include <span> |
3 | 4 | #include <vector> |
4 | 5 |
|
5 | 6 | #include "openvic-simulation/economy/production/Employee.hpp" |
@@ -68,7 +69,7 @@ void ResourceGatheringOperation::initialise_rgo_size_multiplier() { |
68 | 69 | ProvinceInstance& location = *location_ptr; |
69 | 70 | ModifierEffectCache const& modifier_effect_cache = location.get_modifier_effect_cache(); |
70 | 71 | ProductionType const& production_type = *production_type_nullable; |
71 | | - std::vector<Job> const& jobs = production_type.get_jobs(); |
| 72 | + std::span<const Job> jobs = production_type.get_jobs(); |
72 | 73 | IndexedMap<PopType, pop_size_t> const& province_pop_type_distribution = location.get_pop_type_distribution(); |
73 | 74 |
|
74 | 75 | pop_size_t total_worker_count_in_province = 0; //not counting equivalents |
@@ -127,7 +128,7 @@ void ResourceGatheringOperation::rgo_tick(std::vector<fixed_point_t>& reusable_v |
127 | 128 | } |
128 | 129 |
|
129 | 130 | ProductionType const& production_type = *production_type_nullable; |
130 | | - std::vector<Job> const& jobs = production_type.get_jobs(); |
| 131 | + std::span<const Job> jobs = production_type.get_jobs(); |
131 | 132 | IndexedMap<PopType, pop_size_t> const& province_pop_type_distribution = location.get_pop_type_distribution(); |
132 | 133 |
|
133 | 134 | total_worker_count_in_province_cache = 0; //not counting equivalents |
@@ -197,7 +198,7 @@ void ResourceGatheringOperation::hire() { |
197 | 198 | proportion_to_hire = max_worker_count_real / available_worker_count_real; |
198 | 199 | } |
199 | 200 |
|
200 | | - std::vector<Job> const& jobs = production_type.get_jobs(); |
| 201 | + std::span<const Job> jobs = production_type.get_jobs(); |
201 | 202 | for (Pop& pop : location.get_mutable_pops()){ |
202 | 203 | PopType const& pop_type = *pop.get_type(); |
203 | 204 | for (Job const& job : jobs) { |
|
0 commit comments