aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/map/Region.hpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-12-27 21:40:01 +0100
committer GitHub <noreply@github.com>2023-12-27 21:40:01 +0100
commit0d9343e62575b5b7968beea2d36f15541e2351e2 (patch)
tree78e0431edc32edb50be206ad78064eb28879342a /src/openvic-simulation/map/Region.hpp
parentcc808c115d8ec6c7b6e47db47f81395b4d52941f (diff)
parent86e558e69aa5c34395d5f3b17566cf5ad2731af5 (diff)
Merge pull request #109 from OpenVicProject/const-province-set
Made ProvinceSet use Province const* and updated Region loading
Diffstat (limited to 'src/openvic-simulation/map/Region.hpp')
-rw-r--r--src/openvic-simulation/map/Region.hpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/openvic-simulation/map/Region.hpp b/src/openvic-simulation/map/Region.hpp
index 9119b93..e4565c9 100644
--- a/src/openvic-simulation/map/Region.hpp
+++ b/src/openvic-simulation/map/Region.hpp
@@ -5,16 +5,18 @@
namespace OpenVic {
struct ProvinceSet {
- using provinces_t = std::vector<Province*>;
+ using provinces_t = std::vector<Province const*>;
private:
provinces_t provinces;
bool locked = false;
public:
- ProvinceSet(provinces_t&& new_provinces = {});
-
- bool add_province(Province* province);
+ /* Returns true if the province is successfully added, false if not (including if it's already in the set). */
+ bool add_province(Province const* province);
+ bool add_provinces(provinces_t const& new_provinces);
+ /* Returns true if the province is successfully removed, false if not (including if it's not in the set). */
+ bool remove_province(Province const* province);
void lock(bool log = false);
bool is_locked() const;
void reset();
@@ -38,7 +40,7 @@ namespace OpenVic {
*/
const bool meta;
- Region(std::string_view new_identifier, provinces_t&& new_provinces, bool new_meta);
+ Region(std::string_view new_identifier, colour_t new_colour, bool new_meta);
public:
Region(Region&&) = default;