Project Alice
Loading...
Searching...
No Matches
events.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "dcon_generated.hpp"
5#include "container_types.hpp"
6
7namespace event {
8
9inline constexpr int32_t expiration_in_days = 30;
10
12
14 uint32_t r_lo = 0; //0,4
15 uint32_t r_hi = 0; //4,4
16 int32_t primary_slot; //8,4
17 int32_t from_slot; //12,4
19 dcon::national_event_id e; //16,2
20 dcon::nation_id n; //18,2
21 slot_type pt; //20,1
22 slot_type ft; //21,1
23};
24static_assert(sizeof(pending_human_n_event) ==
35 uint32_t r_lo = 0; //0,4
36 uint32_t r_hi = 0; //4,4
38 dcon::free_national_event_id e; //10,2
39 dcon::nation_id n; //12,2
40 uint16_t padding = 0;
41};
42static_assert(sizeof(pending_human_f_n_event) ==
50 uint32_t r_lo = 0; //4
51 uint32_t r_hi = 0; //4
52 int32_t from_slot; //4
54 dcon::provincial_event_id e; //2
55 dcon::province_id p; //2
58};
59static_assert(sizeof(pending_human_p_event) ==
69 uint32_t r_lo = 0; //0,4
70 uint32_t r_hi = 0; //4,4
72 dcon::free_provincial_event_id e; //10,2
73 dcon::province_id p; //12,2
74 uint16_t padding = 0;
75};
76static_assert(sizeof(pending_human_f_p_event) ==
83
84bool is_valid_option(sys::event_option const& opt);
85
86void trigger_national_event(sys::state& state, dcon::national_event_id e, dcon::nation_id n, uint32_t r_hi, uint32_t r_lo,
87 int32_t from_slot = 0, slot_type ft = slot_type::none);
88void trigger_national_event(sys::state& state, dcon::national_event_id e, dcon::nation_id n, uint32_t r_hi, uint32_t r_lo,
89 int32_t primary_slot, slot_type pt, int32_t from_slot, slot_type ft);
90void trigger_national_event(sys::state& state, dcon::free_national_event_id e, dcon::nation_id n, uint32_t r_hi, uint32_t r_lo);
91void trigger_provincial_event(sys::state& state, dcon::provincial_event_id e, dcon::province_id p, uint32_t r_hi, uint32_t r_lo,
92 int32_t from_slot = 0, slot_type ft = slot_type::none);
93void trigger_provincial_event(sys::state& state, dcon::free_provincial_event_id e, dcon::province_id p, uint32_t r_hi,
94 uint32_t r_lo);
95
96void fire_fixed_event(sys::state& state, std::vector<nations::fixed_event> const& v, int32_t primary_slot, slot_type pt, dcon::nation_id this_slot, int32_t from_slot, slot_type ft);
97void fire_fixed_event(sys::state& state, std::vector<nations::fixed_election_event> const& v, int32_t primary_slot, slot_type pt, dcon::nation_id this_slot, int32_t from_slot, slot_type ft);
98void fire_fixed_event(sys::state& state, std::vector<nations::fixed_province_event> const& v, dcon::province_id prov, int32_t from_slot, slot_type ft);
99
104
105bool would_be_duplicate_instance(sys::state& state, dcon::national_event_id e, dcon::nation_id n, sys::date date);
108
109dcon::issue_id get_election_event_issue(sys::state& state, dcon::national_event_id e);
110
111} // namespace event
Definition: events.cpp:8
void take_option(sys::state &state, pending_human_n_event const &e, uint8_t opt)
Definition: events.cpp:14
constexpr int32_t expiration_in_days
Definition: events.hpp:9
slot_type
Definition: events.hpp:11
void update_future_events(sys::state &state)
Definition: events.cpp:473
void trigger_national_event(sys::state &state, dcon::national_event_id e, dcon::nation_id n, uint32_t r_lo, uint32_t r_hi, int32_t primary_slot, slot_type pt, int32_t from_slot, slot_type ft)
Definition: events.cpp:109
void fire_fixed_event(sys::state &state, std::vector< nations::fixed_event > const &v, int32_t primary_slot, slot_type pt, dcon::nation_id this_slot, int32_t from_slot, slot_type ft)
Definition: events.cpp:709
dcon::issue_id get_election_event_issue(sys::state &state, dcon::national_event_id e)
Definition: events.cpp:787
bool would_be_duplicate_instance(sys::state &state, dcon::national_event_id e, dcon::nation_id n, sys::date date)
Definition: events.cpp:459
void update_events(sys::state &state)
Definition: events.cpp:517
void trigger_provincial_event(sys::state &state, dcon::provincial_event_id e, dcon::province_id p, uint32_t r_hi, uint32_t r_lo, int32_t from_slot, slot_type ft)
Definition: events.cpp:295
bool is_valid_option(sys::event_option const &opt)
Definition: events.cpp:10
uint uint32_t
uchar uint8_t
dcon::free_national_event_id e
Definition: events.hpp:38
dcon::province_id p
Definition: events.hpp:73
dcon::free_provincial_event_id e
Definition: events.hpp:72
dcon::national_event_id e
Definition: events.hpp:19
dcon::province_id p
Definition: events.hpp:55
dcon::provincial_event_id e
Definition: events.hpp:54