diff options
author | Hop311 <Hop3114@gmail.com> | 2023-08-12 18:54:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-12 18:54:55 +0200 |
commit | d3c6ff1809b88b4c99163402f30b6d10c787510f (patch) | |
tree | e4bf26ecfef160e7df7670e73af7f154f1550308 /src/openvic/economy/Good.hpp | |
parent | 538e7dc4ec44c4d09a6a654f10229e6392653a50 (diff) | |
parent | afc16e76ba699b24ba1ef1cb1b658ef421c84430 (diff) |
Merge pull request #11 from OpenVicProject/string_view
Changed IdentifierRegistry to use std::string_view when looking up a std::string key
Diffstat (limited to 'src/openvic/economy/Good.hpp')
-rw-r--r-- | src/openvic/economy/Good.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/openvic/economy/Good.hpp b/src/openvic/economy/Good.hpp index 833b17a..cfe185d 100644 --- a/src/openvic/economy/Good.hpp +++ b/src/openvic/economy/Good.hpp @@ -27,7 +27,7 @@ namespace OpenVic { const bool default_available, tradeable, currency, overseas_maintenance; bool available; - Good(std::string const& new_identifier, std::string const& new_category, colour_t new_colour, price_t new_base_price, + Good(const std::string_view new_identifier, colour_t new_colour, const std::string_view new_category, price_t new_base_price, bool new_default_available, bool new_tradeable, bool new_currency, bool new_overseas_maintenance); public: @@ -48,12 +48,13 @@ namespace OpenVic { public: GoodManager(); - return_t add_good(std::string const& identifier, std::string const& category, colour_t colour, price_t base_price, + return_t add_good(const std::string_view identifier, colour_t colour, const std::string_view category, price_t base_price, bool default_available, bool tradeable, bool currency, bool overseas_maintenance); void lock_goods(); void reset_to_defaults(); Good const* get_good_by_index(size_t index) const; + Good const* get_good_by_identifier(const std::string_view identifier) const; size_t get_good_count() const; std::vector<Good> const& get_goods() const; }; |