aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/military/UnitType.hpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-09-10 00:04:30 +0200
committer GitHub <noreply@github.com>2024-09-10 00:04:30 +0200
commit7a9206e3869fbb659d296b854c90f5c81755a5ca (patch)
tree1e00781e634cbb7ea6f31343f6751f7755bd53ef /src/openvic-simulation/military/UnitType.hpp
parent79dbf71dd23623059ea9eabd87956f93604be1ed (diff)
parentd67cd2d08fe2859809e35b93f5a8358c48a3705e (diff)
Merge pull request #195 from OpenVicProject/ranking
Ranking System
Diffstat (limited to 'src/openvic-simulation/military/UnitType.hpp')
-rw-r--r--src/openvic-simulation/military/UnitType.hpp15
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;