aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/military
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2023-12-02 16:48:08 +0100
committer hop311 <hop3114@gmail.com>2023-12-02 20:14:29 +0100
commit4a899c1a9e83ab9476b85522751081be434caa35 (patch)
treef1f6276c91beceecdfd9b09083d1c91ea8b41b60 /src/openvic-simulation/military
parentcd6875d5e0ca5e2545fd0e1647678cd18a6c81c2 (diff)
Crime+event modifier loading + misc UI backend
Diffstat (limited to 'src/openvic-simulation/military')
-rw-r--r--src/openvic-simulation/military/Deployment.hpp2
-rw-r--r--src/openvic-simulation/military/Unit.cpp16
-rw-r--r--src/openvic-simulation/military/Wargoal.hpp36
3 files changed, 27 insertions, 27 deletions
diff --git a/src/openvic-simulation/military/Deployment.hpp b/src/openvic-simulation/military/Deployment.hpp
index ead324e..597f727 100644
--- a/src/openvic-simulation/military/Deployment.hpp
+++ b/src/openvic-simulation/military/Deployment.hpp
@@ -99,7 +99,7 @@ namespace OpenVic {
bool add_deployment(
std::string_view path, std::vector<Army>&& armies, std::vector<Navy>&& navies, std::vector<Leader>&& leaders
);
- IDENTIFIER_REGISTRY_ACCESSORS(deployment)
+ IDENTIFIER_REGISTRY_ACCESSORS(deployment)
bool load_oob_file(
GameManager const& game_manager, Dataloader const& dataloader, std::string_view history_path,
diff --git a/src/openvic-simulation/military/Unit.cpp b/src/openvic-simulation/military/Unit.cpp
index 1c4efcf..7995aeb 100644
--- a/src/openvic-simulation/military/Unit.cpp
+++ b/src/openvic-simulation/military/Unit.cpp
@@ -132,7 +132,7 @@ bool UnitManager::load_unit_file(GoodManager const& good_manager, ast::NodeCPtr
bool primary_culture = false;
std::string_view sprite_override {}, sprite_mount {}, sprite_mount_attach_node {};
fixed_point_t reconnaissance = 0, attack = 0, defence = 0, discipline = 0, support = 0, maneuver = 0, siege = 0;
-
+
ret &= add_key_map_entries(key_map,
"primary_culture", ZERO_OR_ONE, expect_bool(assign_variable_callback(primary_culture)),
"sprite_override", ZERO_OR_ONE, expect_identifier(assign_variable_callback(sprite_override)),
@@ -146,9 +146,9 @@ bool UnitManager::load_unit_file(GoodManager const& good_manager, ast::NodeCPtr
"maneuver", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(maneuver)),
"siege", ZERO_OR_ONE, expect_fixed_point(assign_variable_callback(siege))
);
-
+
ret &= expect_dictionary_key_map(key_map)(value);
-
+
ret &= add_land_unit(key, UNIT_ARGS, LAND_ARGS);
return ret;
@@ -180,9 +180,9 @@ bool UnitManager::load_unit_file(GoodManager const& good_manager, ast::NodeCPtr
);
ret &= expect_dictionary_key_map(key_map)(value);
-
+
ret &= add_naval_unit(key, UNIT_ARGS, NAVY_ARGS);
-
+
return ret;
}
default: Logger::error("Unknown unit type for ", key, ": ", static_cast<int>(type)); return false;
@@ -215,7 +215,7 @@ bool UnitManager::generate_modifiers(ModifierManager& modifier_manager) {
STAT_MODIFIER("siege", true, RAW_DECIMAL);
break;
}
- case Unit::type_t::NAVAL: {
+ case Unit::type_t::NAVAL: {
STAT_MODIFIER("colonial_points", true, INT);
STAT_MODIFIER("supply_consumption_score", false, INT);
STAT_MODIFIER("hull", true, RAW_DECIMAL);
@@ -223,8 +223,8 @@ bool UnitManager::generate_modifiers(ModifierManager& modifier_manager) {
STAT_MODIFIER("fire_range", true, RAW_DECIMAL);
STAT_MODIFIER("evasion", true, PROPORTION_DECIMAL);
STAT_MODIFIER("torpedo_attack", true, RAW_DECIMAL);
- break;
- }
+ break;
+ }
}
return ret;
diff --git a/src/openvic-simulation/military/Wargoal.hpp b/src/openvic-simulation/military/Wargoal.hpp
index ef8170f..f696511 100644
--- a/src/openvic-simulation/military/Wargoal.hpp
+++ b/src/openvic-simulation/military/Wargoal.hpp
@@ -9,24 +9,24 @@ namespace OpenVic {
struct WargoalTypeManager;
enum class peace_options_t : uint32_t {
- PO_ANNEX = 0b100000000000000000,
- PO_DEMAND_STATE = 0b010000000000000000,
- PO_COLONY = 0b001000000000000000,
- PO_ADD_TO_SPHERE = 0b000100000000000000,
- PO_DISARMAMENT = 0b000010000000000000,
- PO_REMOVE_FORTS = 0b000001000000000000,
- PO_REMOVE_NAVAL_BASES = 0b000000100000000000,
- PO_REPARATIONS = 0b000000010000000000,
- PO_REPAY_DEBT = 0b000000001000000000,
- PO_REMOVE_PRESTIGE = 0b000000000100000000,
- PO_MAKE_PUPPET = 0b000000000010000000,
- PO_RELEASE_PUPPET = 0b000000000001000000,
- PO_STATUS_QUO = 0b000000000000100000,
- PO_INSTALL_COMMUNISM = 0b000000000000010000,
- PO_REMOVE_COMMUNISM = 0b000000000000001000,
- PO_REMOVE_CORES = 0b000000000000000100, // only usable with ANNEX, DEMAND_STATE, or TRANSFER_PROVINCES
- PO_TRANSFER_PROVINCES = 0b000000000000000010,
- PO_CLEAR_UNION_SPHERE = 0b000000000000000001
+ PO_ANNEX = 0b100000000000000000,
+ PO_DEMAND_STATE = 0b010000000000000000,
+ PO_COLONY = 0b001000000000000000,
+ PO_ADD_TO_SPHERE = 0b000100000000000000,
+ PO_DISARMAMENT = 0b000010000000000000,
+ PO_REMOVE_FORTS = 0b000001000000000000,
+ PO_REMOVE_NAVAL_BASES = 0b000000100000000000,
+ PO_REPARATIONS = 0b000000010000000000,
+ PO_REPAY_DEBT = 0b000000001000000000,
+ PO_REMOVE_PRESTIGE = 0b000000000100000000,
+ PO_MAKE_PUPPET = 0b000000000010000000,
+ PO_RELEASE_PUPPET = 0b000000000001000000,
+ PO_STATUS_QUO = 0b000000000000100000,
+ PO_INSTALL_COMMUNISM = 0b000000000000010000,
+ PO_REMOVE_COMMUNISM = 0b000000000000001000,
+ PO_REMOVE_CORES = 0b000000000000000100, // only usable with ANNEX, DEMAND_STATE, or TRANSFER_PROVINCES
+ PO_TRANSFER_PROVINCES = 0b000000000000000010,
+ PO_CLEAR_UNION_SPHERE = 0b000000000000000001
};
template<> struct enable_bitfield<peace_options_t> : std::true_type{};