diff options
author | Gone2Daly <71726742+Gone2Daly@users.noreply.github.com> | 2023-04-05 01:04:40 +0200 |
---|---|---|
committer | Gone2Daly <71726742+Gone2Daly@users.noreply.github.com> | 2023-04-05 01:04:40 +0200 |
commit | d3c7e9b27ba60550b23efb9e37cc66b91de0c795 (patch) | |
tree | 0f753afd37019984e18ca3cac74a650c7d3c040f /extension/src/openvic2 | |
parent | c7def7396da00b39eced666ad360397733712bfd (diff) |
Adding province overview panel and selection of province.
Diffstat (limited to 'extension/src/openvic2')
-rw-r--r-- | extension/src/openvic2/Map.cpp | 8 | ||||
-rw-r--r-- | extension/src/openvic2/Map.hpp | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/extension/src/openvic2/Map.cpp b/extension/src/openvic2/Map.cpp index c53b86d..40c421a 100644 --- a/extension/src/openvic2/Map.cpp +++ b/extension/src/openvic2/Map.cpp @@ -26,4 +26,12 @@ bool Map::add_province(std::string const& identifier, Province::colour_t colour, provinces.push_back(new_province); error_message = "Added province: " + new_province.to_string(); return true; +} + +Province Map::get_province(Province::colour_t colour) { + for(Province const& province : provinces) { + if (province.colour == colour) { + return province; + } + } }
\ No newline at end of file diff --git a/extension/src/openvic2/Map.hpp b/extension/src/openvic2/Map.hpp index 3c9c6de..6d8482e 100644 --- a/extension/src/openvic2/Map.hpp +++ b/extension/src/openvic2/Map.hpp @@ -23,6 +23,7 @@ namespace OpenVic2 { public: bool add_province(std::string const& identifier, Province::colour_t colour, std::string& error_message); + Province get_province(Province::colour_t colour); }; } |