diff options
author | wvpm <24685035+wvpm@users.noreply.github.com> | 2024-11-03 22:23:39 +0100 |
---|---|---|
committer | wvpm <24685035+wvpm@users.noreply.github.com> | 2024-11-13 09:35:21 +0100 |
commit | e91bd6c3322a73c3ac6707329e81b6f2edc0b8be (patch) | |
tree | c05ff2506a24bfe7d88a1dad002e3c3ac6eb04e1 /src/openvic-simulation/economy/production/ResourceGatheringOperation.hpp | |
parent | 55eb6aab174172b63c44d801823ed8dc02ff0402 (diff) |
ModifierEffectCache & location to fieldsto_fields
Diffstat (limited to 'src/openvic-simulation/economy/production/ResourceGatheringOperation.hpp')
-rw-r--r-- | src/openvic-simulation/economy/production/ResourceGatheringOperation.hpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/openvic-simulation/economy/production/ResourceGatheringOperation.hpp b/src/openvic-simulation/economy/production/ResourceGatheringOperation.hpp index 5079603..878041e 100644 --- a/src/openvic-simulation/economy/production/ResourceGatheringOperation.hpp +++ b/src/openvic-simulation/economy/production/ResourceGatheringOperation.hpp @@ -8,8 +8,12 @@ #include "openvic-simulation/utility/Getters.hpp" namespace OpenVic { + struct ProvinceInstance; + struct ResourceGatheringOperation { private: + ModifierEffectCache const& modifier_effect_cache; + ProvinceInstance* location_ptr; ProductionType const* PROPERTY_RW(production_type_nullable); fixed_point_t PROPERTY(revenue_yesterday); fixed_point_t PROPERTY(output_quantity_yesterday); @@ -23,16 +27,13 @@ namespace OpenVic { fixed_point_t PROPERTY(total_employee_income_cache); IndexedMap<PopType, Pop::pop_size_t> PROPERTY(employee_count_per_type_cache); - fixed_point_t calculate_size_modifier(ProvinceInstance const& location, ModifierEffectCache const& modifier_effect_cache) const; - void hire(ProvinceInstance& location, const Pop::pop_size_t available_worker_count); + fixed_point_t calculate_size_modifier() const; + void hire(const Pop::pop_size_t available_worker_count); fixed_point_t produce( - ProvinceInstance& location, std::vector<Pop*> const* const owner_pops_cache, - const Pop::pop_size_t total_owner_count_in_state_cache, - ModifierEffectCache const& modifier_effect_cache + const Pop::pop_size_t total_owner_count_in_state_cache ); void pay_employees( - ProvinceInstance& location, const fixed_point_t revenue, const Pop::pop_size_t total_worker_count_in_province, std::vector<Pop*> const* const owner_pops_cache, @@ -41,6 +42,7 @@ namespace OpenVic { public: ResourceGatheringOperation( + ModifierEffectCache const& new_modifier_effect_cache, ProductionType const* new_production_type_nullable, fixed_point_t new_size_multiplier, fixed_point_t new_revenue_yesterday, @@ -49,11 +51,17 @@ namespace OpenVic { std::vector<Employee>&& new_employees, decltype(employee_count_per_type_cache)::keys_t const& pop_type_keys ); - ResourceGatheringOperation(decltype(employee_count_per_type_cache)::keys_t const& pop_type_keys); + + ResourceGatheringOperation( + ModifierEffectCache const& new_modifier_effect_cache, + decltype(employee_count_per_type_cache)::keys_t const& pop_type_keys + ); + constexpr bool is_valid() const { return production_type_nullable != nullptr; } - void initialise_rgo_size_multiplier(ProvinceInstance& location, ModifierEffectCache const& modifier_effect_cache); - void rgo_tick(ProvinceInstance& location, ModifierEffectCache const& modifier_effect_cache); + void setup_location_ptr(ProvinceInstance& location); + void initialise_rgo_size_multiplier(); + void rgo_tick(); }; } |