From ddbb6af66e30e896f07a39503a1bb935e462c095 Mon Sep 17 00:00:00 2001 From: wvpm <24685035+wvpm@users.noreply.github.com> Date: Sun, 7 Jan 2024 13:49:20 +0100 Subject: Reparations & optional end date --- .../history/DiplomaticHistory.hpp | 29 +++++++++++++++------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'src/openvic-simulation/history/DiplomaticHistory.hpp') 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 PROPERTY_CUSTOM_PREFIX(exited, get_date); + Period PROPERTY(period); - war_participant_t(Country const* new_country, Date new_joined, std::optional 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 alliances; + std::vector reparations; std::vector subjects; std::vector wars; bool locked = false; @@ -94,6 +104,7 @@ namespace OpenVic { bool is_locked() const; std::vector get_alliances(Date date) const; + std::vector get_reparations(Date date) const; std::vector 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 get_wars(Date date) const; -- cgit v1.2.3-56-ga3b1