diff options
Diffstat (limited to 'src/openvic-simulation/economy/Good.hpp')
-rw-r--r-- | src/openvic-simulation/economy/Good.hpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/openvic-simulation/economy/Good.hpp b/src/openvic-simulation/economy/Good.hpp index ac85cbd..1537514 100644 --- a/src/openvic-simulation/economy/Good.hpp +++ b/src/openvic-simulation/economy/Good.hpp @@ -1,5 +1,6 @@ #pragma once +#include "openvic-simulation/misc/Modifier.hpp" #include "openvic-simulation/types/IdentifierRegistry.hpp" namespace OpenVic { @@ -30,16 +31,19 @@ namespace OpenVic { struct Good : HasIdentifierAndColour { friend struct GoodManager; + using index_t = size_t; + using price_t = fixed_point_t; static constexpr price_t NULL_PRICE = fixed_point_t::_0(); using good_map_t = fixed_point_map_t<Good const*>; private: + const index_t PROPERTY(index); GoodCategory const& PROPERTY(category); const price_t PROPERTY(base_price); - const bool PROPERTY_CUSTOM_NAME(available_from_start, is_available_from_start); - const bool PROPERTY_CUSTOM_NAME(tradeable, is_tradeable); + const bool PROPERTY_CUSTOM_PREFIX(available_from_start, is); + const bool PROPERTY_CUSTOM_PREFIX(tradeable, is); const bool PROPERTY(money); const bool PROPERTY(overseas_penalty); @@ -47,8 +51,9 @@ namespace OpenVic { bool PROPERTY_RW(available); Good( - std::string_view new_identifier, colour_t new_colour, GoodCategory const& new_category, price_t new_base_price, - bool new_available_from_start, bool new_tradeable, bool new_money, bool new_overseas_penalty + std::string_view new_identifier, colour_t new_colour, index_t new_index, GoodCategory const& new_category, + price_t new_base_price, bool new_available_from_start, bool new_tradeable, bool new_money, + bool new_overseas_penalty ); public: @@ -75,5 +80,6 @@ namespace OpenVic { void reset_to_defaults(); bool load_goods_file(ast::NodeCPtr root); + bool generate_modifiers(ModifierManager& modifier_manager); }; } |