aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/history/DiplomaticHistory.hpp
diff options
context:
space:
mode:
author wvpm <24685035+wvpm@users.noreply.github.com>2024-01-07 13:49:20 +0100
committer wvpm <24685035+wvpm@users.noreply.github.com>2024-01-07 14:57:40 +0100
commitddbb6af66e30e896f07a39503a1bb935e462c095 (patch)
treeaf1d3ab4924675e14a24483dea9b012e235bf5ec /src/openvic-simulation/history/DiplomaticHistory.hpp
parent199a1b7915f4c431e733cfe037608f1310972cb4 (diff)
Reparations & optional end date
Diffstat (limited to 'src/openvic-simulation/history/DiplomaticHistory.hpp')
-rw-r--r--src/openvic-simulation/history/DiplomaticHistory.hpp29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/openvic-simulation/history/DiplomaticHistory.hpp b/src/openvic-simulation/history/DiplomaticHistory.hpp
index 3e877eb..07302ac 100644
--- a/src/openvic-simulation/history/DiplomaticHistory.hpp
+++ b/src/openvic-simulation/history/DiplomaticHistory.hpp
@@ -8,6 +8,7 @@
#include "openvic-simulation/country/Country.hpp"
#include "openvic-simulation/military/Wargoal.hpp"
#include "openvic-simulation/map/Province.hpp"
+#include "openvic-simulation/history/Period.hpp"
namespace OpenVic {
struct DiplomaticHistoryManager;
@@ -34,10 +35,9 @@ namespace OpenVic {
private:
Country const* PROPERTY(country);
- Date PROPERTY_CUSTOM_PREFIX(joined, get_date);
- std::optional<Date> PROPERTY_CUSTOM_PREFIX(exited, get_date);
+ Period PROPERTY(period);
- war_participant_t(Country const* new_country, Date new_joined, std::optional<Date> new_exited);
+ war_participant_t(Country const* new_country, const Period period);
};
private:
@@ -55,10 +55,20 @@ namespace OpenVic {
private:
Country const* PROPERTY(first);
Country const* PROPERTY(second);
- const Date start;
- const Date end;
+ const Period PROPERTY(period);
- AllianceHistory(Country const* new_first, Country const* new_second, const Date new_start, const Date new_end);
+ AllianceHistory(Country const* new_first, Country const* new_second, const Period period);
+ };
+
+ struct ReparationsHistory {
+ friend struct DiplomaticHistoryManager;
+
+ private:
+ Country const* PROPERTY(receiver);
+ Country const* PROPERTY(sender);
+ const Period PROPERTY(period);
+
+ ReparationsHistory(Country const* new_receiver, Country const* new_sender, const Period period);
};
struct SubjectHistory {
@@ -74,15 +84,15 @@ namespace OpenVic {
Country const* PROPERTY(overlord);
Country const* PROPERTY(subject);
const type_t PROPERTY_CUSTOM_PREFIX(type, get_subject);
- const Date start;
- const Date end;
+ const Period PROPERTY(period);
- SubjectHistory(Country const* new_overlord, Country const* new_subject, const type_t new_type, const Date new_start, const Date new_end);
+ SubjectHistory(Country const* new_overlord, Country const* new_subject, const type_t new_type, const Period period);
};
struct DiplomaticHistoryManager {
private:
std::vector<AllianceHistory> alliances;
+ std::vector<ReparationsHistory> reparations;
std::vector<SubjectHistory> subjects;
std::vector<WarHistory> wars;
bool locked = false;
@@ -94,6 +104,7 @@ namespace OpenVic {
bool is_locked() const;
std::vector<AllianceHistory const*> get_alliances(Date date) const;
+ std::vector<ReparationsHistory const*> get_reparations(Date date) const;
std::vector<SubjectHistory const*> get_subjects(Date date) const;
/* Returns all wars that begin before date. NOTE: Some wargoals may be added or countries may join after date, should be checked for by functions that use get_wars() */
std::vector<WarHistory const*> get_wars(Date date) const;