diff options
author | hop311 <hop3114@gmail.com> | 2024-09-07 00:13:47 +0200 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2024-09-09 19:25:27 +0200 |
commit | d67cd2d08fe2859809e35b93f5a8358c48a3705e (patch) | |
tree | e3f5b453affdb38e5a0c08513c404de652fce738 /src/openvic-simulation/military/UnitType.hpp | |
parent | 16349d6cad05497f983b1da123b6284ecfddd638 (diff) |
Calculate country military power (still needs modifiers + soldier pop supported regiment count)ranking
Diffstat (limited to 'src/openvic-simulation/military/UnitType.hpp')
-rw-r--r-- | src/openvic-simulation/military/UnitType.hpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/openvic-simulation/military/UnitType.hpp b/src/openvic-simulation/military/UnitType.hpp index 6bd7392..6bbaca7 100644 --- a/src/openvic-simulation/military/UnitType.hpp +++ b/src/openvic-simulation/military/UnitType.hpp @@ -15,6 +15,8 @@ namespace OpenVic { struct TerrainType; struct TerrainTypeManager; + struct Culture; + struct CountryInstance; struct UnitType : HasIdentifier { using icon_t = uint32_t; @@ -94,7 +96,18 @@ namespace OpenVic { struct UnitTypeBranched<UnitType::branch_t::LAND> : UnitType { friend struct UnitTypeManager; - enum struct allowed_cultures_t { ALL_CULTURES, ACCEPTED_CULTURES, PRIMARY_CULTURE }; + // Each value is a subset of its predecessor, so smaller values contain larger values + enum struct allowed_cultures_t { ALL_CULTURES, ACCEPTED_CULTURES, PRIMARY_CULTURE, NO_CULTURES }; + + constexpr static allowed_cultures_t allowed_cultures_get_most_permissive( + allowed_cultures_t lhs, allowed_cultures_t rhs + ) { + return std::min(lhs, rhs); + } + + static bool allowed_cultures_check_culture_in_country( + allowed_cultures_t allowed_cultures, Culture const& culture, CountryInstance const& country + ); struct regiment_type_args_t { allowed_cultures_t allowed_cultures = allowed_cultures_t::ALL_CULTURES; |