summaryrefslogtreecommitdiff
path: root/src/openvic/economy
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvic/economy')
-rw-r--r--src/openvic/economy/Good.cpp12
-rw-r--r--src/openvic/economy/Good.hpp8
2 files changed, 10 insertions, 10 deletions
diff --git a/src/openvic/economy/Good.cpp b/src/openvic/economy/Good.cpp
index 6d515d5..52b908c 100644
--- a/src/openvic/economy/Good.cpp
+++ b/src/openvic/economy/Good.cpp
@@ -4,7 +4,7 @@
using namespace OpenVic;
-Good::Good(std::string const& new_identifier, std::string const& new_category, colour_t new_colour, price_t new_base_price,
+Good::Good(ovstring const& new_identifier, ovstring const& new_category, colour_t new_colour, price_t new_base_price,
bool new_default_available, bool new_tradeable, bool new_currency, bool new_overseas_maintenance)
: HasIdentifier { new_identifier },
HasColour { new_colour, true },
@@ -17,7 +17,7 @@ Good::Good(std::string const& new_identifier, std::string const& new_category, c
assert(base_price > NULL_PRICE);
}
-std::string const& Good::get_category() const {
+ovstring const& Good::get_category() const {
return category;
}
@@ -44,18 +44,18 @@ void Good::reset_to_defaults() {
GoodManager::GoodManager() : goods { "goods" } {}
-return_t GoodManager::add_good(std::string const& identifier, std::string const& category, colour_t colour,
+return_t GoodManager::add_good(ovstring const& identifier, ovstring const& category, colour_t colour,
price_t base_price, bool default_available, bool tradeable, bool currency, bool overseas_maintenance) {
if (identifier.empty()) {
- Logger::error("Invalid good identifier - empty!");
+ // Logger::error("Invalid good identifier - empty!");
return FAILURE;
}
if (category.empty()) {
- Logger::error("Invalid good category - empty!");
+ // Logger::error("Invalid good category - empty!");
return FAILURE;
}
if (base_price <= NULL_PRICE) {
- Logger::error("Invalid base price for ", identifier, ": ", base_price);
+ // Logger::error("Invalid base price for ", identifier, ": ", base_price);
return FAILURE;
}
return goods.add_item({ identifier, category, colour, base_price, default_available, tradeable, currency, overseas_maintenance });
diff --git a/src/openvic/economy/Good.hpp b/src/openvic/economy/Good.hpp
index 577280d..b75e52c 100644
--- a/src/openvic/economy/Good.hpp
+++ b/src/openvic/economy/Good.hpp
@@ -19,19 +19,19 @@ namespace OpenVic {
friend struct GoodManager;
private:
- const std::string category;
+ const ovstring category;
const price_t base_price;
price_t price;
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(ovstring const& new_identifier, ovstring const& new_category, colour_t new_colour, price_t new_base_price,
bool new_default_available, bool new_tradeable, bool new_currency, bool new_overseas_maintenance);
public:
Good(Good&&) = default;
- std::string const& get_category() const;
+ ovstring const& get_category() const;
price_t get_base_price() const;
price_t get_price() const;
bool is_default_available() const;
@@ -46,7 +46,7 @@ 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(ovstring const& identifier, ovstring const& category, colour_t colour, price_t base_price,
bool default_available, bool tradeable, bool currency, bool overseas_maintenance);
void lock_goods();
void reset_to_defaults();