diff options
author | Hop311 <Hop3114@gmail.com> | 2023-11-22 23:11:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-22 23:11:42 +0100 |
commit | a54898b7770e0d66b729216173960686c67e58bb (patch) | |
tree | af8ed836a4789ef94c5bfed27abb713922f45af3 /src/openvic-simulation/economy/Good.hpp | |
parent | e76336cd92639f4ec71088fc4c80aea4c25528cd (diff) | |
parent | 738a203e0d8b4df87c42888043b99c13d5d97511 (diff) |
Merge pull request #78 from OpenVicProject/property-macro
Refactoring (*mostly* related to the property macro)
Diffstat (limited to 'src/openvic-simulation/economy/Good.hpp')
-rw-r--r-- | src/openvic-simulation/economy/Good.hpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/openvic-simulation/economy/Good.hpp b/src/openvic-simulation/economy/Good.hpp index 805e6a5..ac85cbd 100644 --- a/src/openvic-simulation/economy/Good.hpp +++ b/src/openvic-simulation/economy/Good.hpp @@ -36,11 +36,15 @@ namespace OpenVic { using good_map_t = fixed_point_map_t<Good const*>; private: - GoodCategory const& category; - const price_t base_price; - price_t price; - const bool available_from_start, tradeable, money, overseas_penalty; - bool available; + 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(money); + const bool PROPERTY(overseas_penalty); + + price_t PROPERTY_RW(price); + bool PROPERTY_RW(available); Good( std::string_view new_identifier, colour_t new_colour, GoodCategory const& new_category, price_t new_base_price, @@ -49,15 +53,6 @@ namespace OpenVic { public: Good(Good&&) = default; - - GoodCategory const& get_category() const; - price_t get_base_price() const; - price_t get_price() const; - bool get_available_from_start() const; - bool get_available() const; - bool get_tradeable() const; - bool get_money() const; - bool get_overseas_penalty(); void reset_to_defaults(); }; |