aboutsummaryrefslogtreecommitdiff
path: root/src/openvic/pop/Pop.hpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-08-12 18:54:55 +0200
committer GitHub <noreply@github.com>2023-08-12 18:54:55 +0200
commitd3c6ff1809b88b4c99163402f30b6d10c787510f (patch)
treee4bf26ecfef160e7df7670e73af7f154f1550308 /src/openvic/pop/Pop.hpp
parent538e7dc4ec44c4d09a6a654f10229e6392653a50 (diff)
parentafc16e76ba699b24ba1ef1cb1b658ef421c84430 (diff)
Merge pull request #11 from OpenVicProject/string_view
Changed IdentifierRegistry to use std::string_view when looking up a std::string key
Diffstat (limited to 'src/openvic/pop/Pop.hpp')
-rw-r--r--src/openvic/pop/Pop.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/openvic/pop/Pop.hpp b/src/openvic/pop/Pop.hpp
index 628194d..5bd1b90 100644
--- a/src/openvic/pop/Pop.hpp
+++ b/src/openvic/pop/Pop.hpp
@@ -57,7 +57,7 @@ namespace OpenVic {
// TODO - rebel composition, life/everyday/luxury needs, country and province migration targets, promote_to targets, ideologies and issues
- PopType(std::string const& new_identifier, colour_t new_colour, strata_t new_strata, sprite_t new_sprite, Pop::pop_size_t new_max_size, Pop::pop_size_t new_merge_max_size,
+ PopType(const std::string_view new_identifier, colour_t new_colour, strata_t new_strata, sprite_t new_sprite, Pop::pop_size_t new_max_size, Pop::pop_size_t new_merge_max_size,
bool new_state_capital_only, bool new_demote_migrant, bool new_is_artisan, bool new_is_slave);
public:
@@ -83,11 +83,11 @@ namespace OpenVic {
public:
PopManager();
- return_t add_pop_type(std::string const& identifier, colour_t new_colour, PopType::strata_t strata, PopType::sprite_t sprite,
+ return_t add_pop_type(const std::string_view identifier, colour_t new_colour, PopType::strata_t strata, PopType::sprite_t sprite,
Pop::pop_size_t max_size, Pop::pop_size_t merge_max_size, bool state_capital_only, bool demote_migrant,
bool is_artisan, bool is_slave);
void lock_pop_types();
- PopType const* get_pop_type_by_identifier(std::string const& identifier) const;
+ PopType const* get_pop_type_by_identifier(const std::string_view identifier) const;
void generate_test_pops(Province& province) const;
};