aboutsummaryrefslogtreecommitdiff
path: root/src/openvic/economy
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvic/economy')
-rw-r--r--src/openvic/economy/Good.cpp14
-rw-r--r--src/openvic/economy/Good.hpp5
2 files changed, 13 insertions, 6 deletions
diff --git a/src/openvic/economy/Good.cpp b/src/openvic/economy/Good.cpp
index b4fa060..6d515d5 100644
--- a/src/openvic/economy/Good.cpp
+++ b/src/openvic/economy/Good.cpp
@@ -6,9 +6,14 @@ using namespace OpenVic;
Good::Good(std::string const& new_identifier, std::string 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 }, category{ new_category }, base_price{ new_base_price },
- default_available{ new_default_available }, tradeable{ new_tradeable }, currency{ new_currency },
- overseas_maintenance{ new_overseas_maintenance } {
+ : HasIdentifier { new_identifier },
+ HasColour { new_colour, true },
+ category { new_category },
+ base_price { new_base_price },
+ default_available { new_default_available },
+ tradeable { new_tradeable },
+ currency { new_currency },
+ overseas_maintenance { new_overseas_maintenance } {
assert(base_price > NULL_PRICE);
}
@@ -37,7 +42,7 @@ void Good::reset_to_defaults() {
price = base_price;
}
-GoodManager::GoodManager() : goods{ "goods" } {}
+GoodManager::GoodManager() : goods { "goods" } {}
return_t GoodManager::add_good(std::string const& identifier, std::string const& category, colour_t colour,
price_t base_price, bool default_available, bool tradeable, bool currency, bool overseas_maintenance) {
@@ -76,4 +81,3 @@ size_t GoodManager::get_good_count() const {
std::vector<Good> const& GoodManager::get_goods() const {
return goods.get_items();
}
-
diff --git a/src/openvic/economy/Good.hpp b/src/openvic/economy/Good.hpp
index 75f5a73..577280d 100644
--- a/src/openvic/economy/Good.hpp
+++ b/src/openvic/economy/Good.hpp
@@ -9,7 +9,7 @@ namespace OpenVic {
* ECON-15, ECON-16, ECON-17, ECON-18, ECON-19, ECON-20, ECON-21, ECON-22, ECON-23, ECON-24, ECON-25, ECON-26,
* ECON-27, ECON-28, ECON-29, ECON-30, ECON-31, ECON-32, ECON-33, ECON-34, ECON-35, ECON-36, ECON-37, ECON-38,
* ECON-39, ECON-40, ECON-41, ECON-42, ECON-43, ECON-44, ECON-45, ECON-46, ECON-47, ECON-48, ECON-49, ECON-50
- *
+ *
* ECON-123, ECON-124, ECON-125, ECON-126, ECON-127, ECON-128, ECON-129, ECON-130, ECON-131, ECON-132, ECON-133, ECON-134,
* ECON-135, ECON-136, ECON-137, ECON-138, ECON-139, ECON-140, ECON-141, ECON-142, ECON-234, ECON-235, ECON-236, ECON-237,
* ECON-238, ECON-239, ECON-240, ECON-241, ECON-242, ECON-243, ECON-244, ECON-245, ECON-246, ECON-247, ECON-248, ECON-249,
@@ -17,6 +17,7 @@ namespace OpenVic {
*/
struct Good : HasIdentifier, HasColour {
friend struct GoodManager;
+
private:
const std::string category;
const price_t base_price;
@@ -26,6 +27,7 @@ namespace OpenVic {
Good(std::string const& new_identifier, std::string 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;
@@ -40,6 +42,7 @@ namespace OpenVic {
struct GoodManager {
private:
IdentifierRegistry<Good> goods;
+
public:
GoodManager();