aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic2/map/Province.cpp
diff options
context:
space:
mode:
author ClarkeCode <33846391+ClarkeCode@users.noreply.github.com>2023-04-29 03:39:28 +0200
committer GitHub <noreply@github.com>2023-04-29 03:39:28 +0200
commit1f8545facd248bbf4ea0cd551fea5f7d9b0efdce (patch)
tree0accf6d2c5479afb99649351ccf485b63520ac81 /extension/src/openvic2/map/Province.cpp
parent05937359e8c53ee76dc3ce537dd70083a016f766 (diff)
parentef0d15bef9c35f261c4d09bbb23a2b8731acd3fc (diff)
Merge pull request #100 from OpenVic2Project/goods
Addition of goods struct
Diffstat (limited to 'extension/src/openvic2/map/Province.cpp')
-rw-r--r--extension/src/openvic2/map/Province.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/extension/src/openvic2/map/Province.cpp b/extension/src/openvic2/map/Province.cpp
index 4360bce..472cccb 100644
--- a/extension/src/openvic2/map/Province.cpp
+++ b/extension/src/openvic2/map/Province.cpp
@@ -7,25 +7,15 @@
using namespace OpenVic2;
Province::Province(index_t new_index, std::string const& new_identifier, colour_t new_colour) :
- HasIdentifier{ new_identifier }, index{ new_index }, colour{ new_colour }, buildings{ "buildings" } {
+ HasIdentifier{ new_identifier }, HasColour{ new_colour }, index{ new_index }, buildings{ "buildings" } {
assert(index != NULL_INDEX);
- assert(colour != NULL_COLOUR);
+ assert(new_colour != NULL_COLOUR);
}
-std::string Province::colour_to_hex_string(colour_t colour) {
- std::ostringstream stream;
- stream << std::hex << std::setfill('0') << std::setw(6) << colour;
- return stream.str();
-}
-
-Province::index_t Province::get_index() const {
+index_t Province::get_index() const {
return index;
}
-Province::colour_t Province::get_colour() const {
- return colour;
-}
-
Region* Province::get_region() const {
return region;
}
@@ -62,7 +52,7 @@ return_t Province::expand_building(std::string const& building_type_identifier)
std::string Province::to_string() const {
std::stringstream stream;
- stream << "(#" << std::to_string(index) << ", " << get_identifier() << ", 0x" << colour_to_hex_string(colour) << ")";
+ stream << "(#" << std::to_string(index) << ", " << get_identifier() << ", 0x" << colour_to_hex_string() << ")";
return stream.str();
}