Project Alice
Loading...
Searching...
No Matches
politics.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "date_interface.hpp"
4#include "dcon_generated.hpp"
5#include "system_state.hpp"
6#include <string_view>
7
8namespace politics {
9
10float vote_total(sys::state& state, dcon::nation_id nation);
11float pop_vote_weight(sys::state& state, dcon::pop_id p, dcon::nation_id n);
12float get_popular_support(sys::state& state, dcon::nation_id nation, dcon::issue_option_id issue_option);
13float get_voter_support(sys::state& state, dcon::nation_id nation, dcon::issue_option_id issue_option);
14
15bool can_appoint_ruling_party(sys::state& state, dcon::nation_id nation);
16bool is_election_ongoing(sys::state& state, dcon::nation_id nation);
17bool has_elections(sys::state& state, dcon::nation_id nation);
18sys::date next_election_date(sys::state& state, dcon::nation_id nation);
19
20dcon::reform_id get_reform_by_name(sys::state& state, std::string_view name);
21dcon::issue_id get_issue_by_name(sys::state& state, std::string_view name);
22bool reform_is_selected(sys::state& state, dcon::nation_id nation, dcon::reform_option_id reform_option);
23bool issue_is_selected(sys::state& state, dcon::nation_id nation, dcon::issue_option_id issue_option);
24bool can_enact_political_reform(sys::state& state, dcon::nation_id nation, dcon::issue_option_id issue_option);
25bool can_enact_social_reform(sys::state& state, dcon::nation_id nation, dcon::issue_option_id issue_option);
26bool can_enact_military_reform(sys::state& state, dcon::nation_id nation, dcon::reform_option_id reform_option);
27bool can_enact_economic_reform(sys::state& state, dcon::nation_id nation, dcon::reform_option_id reform_option);
28float get_military_reform_multiplier(sys::state& state, dcon::nation_id nation);
29float get_economic_reform_multiplier(sys::state& state, dcon::nation_id nation);
30bool political_party_is_active(sys::state& state, dcon::nation_id n, dcon::political_party_id p);
31
32// sets upperhouse to 100% and changes ruling party to match the ideology
33void force_nation_ideology(sys::state& state, dcon::nation_id n, dcon::ideology_id i);
34// just changes ruling party
35void force_ruling_party_ideology(sys::state& state, dcon::nation_id n, dcon::ideology_id id);
36
37void appoint_ruling_party(sys::state& state, dcon::nation_id n, dcon::political_party_id p);
38void set_ruling_party(sys::state& state, dcon::nation_id n, dcon::political_party_id p); // directly sets ruling party. Use appoint ruling party, generally
39
40// use this function for update flag, name, adjective, and color based on government type changes
41void update_displayed_identity(sys::state& state, dcon::nation_id n);
42
43void change_government_type(sys::state& state, dcon::nation_id n, dcon::government_type_id new_type);
44
45// this function sets the upper house (for example, as when performing the yearly upper house update)
46void recalculate_upper_house(sys::state& state, dcon::nation_id n);
47
48float party_total_support(sys::state& state, dcon::pop_id pop, dcon::political_party_id par_id, dcon::nation_id nat_id, dcon::province_id prov_id);
49void update_elections(sys::state& state);
51void start_election(sys::state& state, dcon::nation_id n);
52void set_issue_option(sys::state& state, dcon::nation_id n, dcon::issue_option_id opt);
53void set_reform_option(sys::state& state, dcon::nation_id n, dcon::reform_option_id opt);
54
55} // namespace politics
void daily_party_loyalty_update(sys::state &state)
Definition: politics.cpp:690
bool can_enact_social_reform(sys::state &state, dcon::nation_id n, dcon::issue_option_id o)
Definition: politics.cpp:181
float pop_vote_weight(sys::state &state, dcon::pop_id p, dcon::nation_id n)
Definition: politics.cpp:477
float get_military_reform_multiplier(sys::state &state, dcon::nation_id n)
Definition: politics.cpp:293
float vote_total(sys::state &state, dcon::nation_id nation)
Definition: politics.cpp:11
bool can_enact_political_reform(sys::state &state, dcon::nation_id nation, dcon::issue_option_id issue_option)
Definition: politics.cpp:107
float get_economic_reform_multiplier(sys::state &state, dcon::nation_id n)
Definition: politics.cpp:308
float get_voter_support(sys::state &state, dcon::nation_id nation, dcon::issue_option_id issue_option)
Definition: politics.cpp:33
bool reform_is_selected(sys::state &state, dcon::nation_id nation, dcon::reform_option_id reform_option)
Definition: politics.cpp:97
void recalculate_upper_house(sys::state &state, dcon::nation_id n)
Definition: politics.cpp:523
dcon::issue_id get_issue_by_name(sys::state &state, std::string_view name)
Definition: politics.cpp:83
sys::date next_election_date(sys::state &state, dcon::nation_id nation)
Definition: politics.cpp:64
void force_ruling_party_ideology(sys::state &state, dcon::nation_id n, dcon::ideology_id id)
Definition: politics.cpp:350
void force_nation_ideology(sys::state &state, dcon::nation_id n, dcon::ideology_id id)
Definition: politics.cpp:422
dcon::reform_id get_reform_by_name(sys::state &state, std::string_view name)
Definition: politics.cpp:69
bool can_appoint_ruling_party(sys::state &state, dcon::nation_id nation)
Definition: politics.cpp:51
void set_issue_option(sys::state &state, dcon::nation_id n, dcon::issue_option_id opt)
Definition: politics.cpp:980
bool political_party_is_active(sys::state &state, dcon::nation_id n, dcon::political_party_id p)
Definition: politics.cpp:323
void change_government_type(sys::state &state, dcon::nation_id n, dcon::government_type_id new_type)
Definition: politics.cpp:441
void update_displayed_identity(sys::state &state, dcon::nation_id id)
Definition: politics.cpp:429
float get_popular_support(sys::state &state, dcon::nation_id nation, dcon::issue_option_id issue_option)
Definition: politics.cpp:24
bool can_enact_military_reform(sys::state &state, dcon::nation_id n, dcon::reform_option_id o)
Definition: politics.cpp:253
void set_reform_option(sys::state &state, dcon::nation_id n, dcon::reform_option_id opt)
Definition: politics.cpp:990
bool issue_is_selected(sys::state &state, dcon::nation_id nation, dcon::issue_option_id issue_option)
Definition: politics.cpp:102
bool has_elections(sys::state &state, dcon::nation_id nation)
Definition: politics.cpp:60
float party_total_support(sys::state &state, dcon::pop_id pop, dcon::political_party_id par_id, dcon::nation_id nat_id, dcon::province_id prov_id)
Definition: politics.cpp:702
void appoint_ruling_party(sys::state &state, dcon::nation_id n, dcon::political_party_id p)
Definition: politics.cpp:364
void update_elections(sys::state &state)
Definition: politics.cpp:751
void set_ruling_party(sys::state &state, dcon::nation_id n, dcon::political_party_id p)
Definition: politics.cpp:333
void start_election(sys::state &state, dcon::nation_id n)
Definition: politics.cpp:732
bool is_election_ongoing(sys::state &state, dcon::nation_id nation)
Definition: politics.cpp:55
bool can_enact_economic_reform(sys::state &state, dcon::nation_id n, dcon::reform_option_id o)
Definition: politics.cpp:273