Project Alice
Loading...
Searching...
No Matches
map_modes.cpp
Go to the documentation of this file.
1#include "map_modes.hpp"
2
3#include "color.hpp"
4#include "demographics.hpp"
5#include "system_state.hpp"
6#include "dcon_generated.hpp"
7#include "province.hpp"
8#include "nations.hpp"
9#include <unordered_map>
10
11#include "modes/political.hpp"
12#include "modes/supply.hpp"
13#include "modes/region.hpp"
14#include "modes/nationality.hpp"
15#include "modes/population.hpp"
16#include "modes/sphere.hpp"
17#include "modes/diplomatic.hpp"
18#include "modes/rank.hpp"
19#include "modes/relation.hpp"
20#include "modes/recruitment.hpp"
22#include "modes/migration.hpp"
24#include "modes/revolt.hpp"
26#include "modes/admin.hpp"
27#include "modes/naval.hpp"
29#include "modes/crisis.hpp"
30#include "modes/colonial.hpp"
31#include "modes/rgo_output.hpp"
32#include "modes/religion.hpp"
33
34//
35// EXTRA MAP MODES
36//
37std::vector<uint32_t> ideology_map_from(sys::state& state) {
38 uint32_t province_size = state.world.province_size() + 1;
39 uint32_t texture_size = province_size + 256 - province_size % 256;
40 std::vector<uint32_t> prov_color(texture_size * 2);
41 if(state.map_state.get_selected_province()) {
42 auto fat_id = state.world.province_get_dominant_ideology(state.map_state.get_selected_province());
43 if(bool(fat_id)) {
44 uint32_t full_color = fat_id.get_color();
45 uint32_t empty_color = 0xDDDDDD;
46 // Make the other end of the gradient dark if the color is bright and vice versa.
47 if((full_color & 0xFF) + (full_color >> 8 & 0xFF) + (full_color >> 16 & 0xFF) > 140 * 3) {
48 empty_color = 0x222222;
49 }
50 auto const pkey = pop_demographics::to_key(state, fat_id.id);
51 state.world.for_each_province([&](dcon::province_id prov_id) {
52 auto i = province::to_map_id(prov_id);
53 float total = 0.f;
54 float value = 0.f;
55 for(const auto pl : state.world.province_get_pop_location_as_province(prov_id)) {
56 value += pop_demographics::get_demo(state, pl.get_pop(), pkey) * pl.get_pop().get_size();
57 total += pl.get_pop().get_size();
58 }
59 auto ratio = value / total;
60 auto color = ogl::color_gradient(ratio, full_color, empty_color);
61 prov_color[i] = color;
62 prov_color[i + texture_size] = color;
63 });
64 }
65 } else {
66 state.world.for_each_province([&](dcon::province_id prov_id) {
67 auto id = province::to_map_id(prov_id);
68 float total_pops = state.world.province_get_demographics(prov_id, demographics::total);
69 dcon::ideology_id primary_id;
70 dcon::ideology_id secondary_id;
71 float primary_percent = 0.f;
72 float secondary_percent = 0.f;
73 state.world.for_each_ideology([&](dcon::ideology_id id) {
74 auto demo_key = demographics::to_key(state, id);
75 auto volume = state.world.province_get_demographics(prov_id, demo_key);
76 float percent = volume / total_pops;
77 if(percent > primary_percent) {
78 secondary_id = primary_id;
79 secondary_percent = primary_percent;
80 primary_id = id;
81 primary_percent = percent;
82 } else if(percent > secondary_percent) {
83 secondary_id = id;
84 secondary_percent = percent;
85 }
86 });
87 uint32_t primary_color = dcon::fatten(state.world, primary_id).get_color();
88 uint32_t secondary_color = 0xFFAAAAAA; // This color won't be reached
89 if(bool(secondary_id)) {
90 secondary_color = dcon::fatten(state.world, secondary_id).get_color();
91 }
92 if(secondary_percent >= primary_percent * 0.75f) {
93 prov_color[id] = primary_color;
94 prov_color[id + texture_size] = secondary_color;
95 } else {
96 prov_color[id] = primary_color;
97 prov_color[id + texture_size] = primary_color;
98 }
99 });
100 }
101 return prov_color;
102}
103
104std::vector<uint32_t> issue_map_from(sys::state& state) {
105 uint32_t province_size = state.world.province_size() + 1;
106 uint32_t texture_size = province_size + 256 - province_size % 256;
107 std::vector<uint32_t> prov_color(texture_size * 2);
108 if(state.map_state.get_selected_province()) {
109 auto fat_id = state.world.province_get_dominant_issue_option(state.map_state.get_selected_province());
110 if(bool(fat_id)) {
111 uint32_t full_color = ogl::get_ui_color(state, fat_id.id);
112 uint32_t empty_color = 0xDDDDDD;
113 // Make the other end of the gradient dark if the color is bright and vice versa.
114 if((full_color & 0xFF) + (full_color >> 8 & 0xFF) + (full_color >> 16 & 0xFF) > 140 * 3) {
115 empty_color = 0x222222;
116 }
117 auto const pkey = pop_demographics::to_key(state, fat_id.id);
118 state.world.for_each_province([&](dcon::province_id prov_id) {
119 auto i = province::to_map_id(prov_id);
120 float total = 0.f;
121 float value = 0.f;
122 for(const auto pl : state.world.province_get_pop_location_as_province(prov_id)) {
123 value += pop_demographics::get_demo(state, pl.get_pop(), pkey) * pl.get_pop().get_size();
124 total += pl.get_pop().get_size();
125 }
126 auto ratio = value / total;
127 auto color = ogl::color_gradient(ratio, full_color, empty_color);
128 prov_color[i] = color;
129 prov_color[i + texture_size] = color;
130 });
131 }
132 } else {
133 state.world.for_each_province([&](dcon::province_id prov_id) {
134 auto id = province::to_map_id(prov_id);
135 float total_pops = state.world.province_get_demographics(prov_id, demographics::total);
136 dcon::issue_option_id primary_id;
137 dcon::issue_option_id secondary_id;
138 float primary_percent = 0.f;
139 float secondary_percent = 0.f;
140 state.world.for_each_issue_option([&](dcon::issue_option_id id) {
141 auto demo_key = demographics::to_key(state, id);
142 auto volume = state.world.province_get_demographics(prov_id, demo_key);
143 float percent = volume / total_pops;
144 if(percent > primary_percent) {
145 secondary_id = primary_id;
146 secondary_percent = primary_percent;
147 primary_id = id;
148 primary_percent = percent;
149 } else if(percent > secondary_percent) {
150 secondary_id = id;
151 secondary_percent = percent;
152 }
153 });
154 uint32_t primary_color = ogl::get_ui_color(state, primary_id);
155 uint32_t secondary_color = 0xFFAAAAAA; // This color won't be reached
156 if(bool(secondary_id)) {
157 secondary_color = ogl::get_ui_color(state, secondary_id);
158 }
159 if(secondary_percent >= primary_percent * 0.75f) {
160 prov_color[id] = primary_color;
161 prov_color[id + texture_size] = secondary_color;
162 } else {
163 prov_color[id] = primary_color;
164 prov_color[id + texture_size] = primary_color;
165 }
166 });
167 }
168 return prov_color;
169}
170
171std::vector<uint32_t> fort_map_from(sys::state& state) {
172 uint32_t province_size = state.world.province_size();
173 uint32_t texture_size = province_size + 256 - province_size % 256;
174 std::vector<uint32_t> prov_color(texture_size * 2);
175 int32_t max_lvl = state.economy_definitions.building_definitions[int32_t(economy::province_building_type::fort)].max_level;
176 state.world.for_each_province([&](dcon::province_id prov_id) {
177 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
178 int32_t current_lvl = state.world.province_get_building_level(prov_id, uint8_t(economy::province_building_type::fort));
179 int32_t max_local_lvl = state.world.nation_get_max_building_level(state.local_player_nation, uint8_t(economy::province_building_type::fort));
180 uint32_t color = 0x222222;
181 uint32_t stripe_color = 0x222222;
182
183 if(current_lvl > 0) {
184 color = ogl::color_gradient(
185 float(current_lvl) / float(max_lvl),
186 sys::pack_color(14, 240, 44), // green
187 sys::pack_color(41, 5, 245) // blue
188 );
189 }
190 if(province::can_build_fort(state, prov_id, state.local_player_nation)) {
191 stripe_color = sys::pack_color(232, 228, 111); // yellow
192 } else if(nation == state.local_player_nation && province::has_fort_being_built(state, prov_id)) {
193 stripe_color = sys::pack_color(247, 15, 15); // yellow
194 } else {
195 stripe_color = color;
196 }
197 auto i = province::to_map_id(prov_id);
198 prov_color[i] = color;
199 prov_color[i + texture_size] = stripe_color;
200 });
201 return prov_color;
202}
203
204std::vector<uint32_t> factory_map_from(sys::state& state) {
205 uint32_t province_size = state.world.province_size();
206 uint32_t texture_size = province_size + 256 - province_size % 256;
207 std::vector<uint32_t> prov_color(texture_size * 2);
208
209 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
210 // get state with most factories
211 int32_t max_total = 0;
212 state.world.for_each_state_instance([&](dcon::state_instance_id sid) {
213 auto sdef = state.world.state_instance_get_definition(sid);
214 int32_t total = 0;
215 if(sel_nation) {
216 total = economy::state_factory_count(state, sid, sel_nation);
217 } else {
218 for(const auto abm : state.world.state_definition_get_abstract_state_membership(sdef)) {
219 total = std::max(total, economy::state_factory_count(state, sid, abm.get_province().get_nation_from_province_ownership()));
220 }
221 }
222 if(total > max_total)
223 max_total = total;
224 if(max_total == 0)
225 max_total = 1;
226 });
227 state.world.for_each_state_instance([&](dcon::state_instance_id sid) {
228 int32_t total = 0;
229 auto sdef = state.world.state_instance_get_definition(sid);
230
231 for(const auto abm : state.world.state_definition_get_abstract_state_membership(sdef)) {
232 if((sel_nation && abm.get_province().get_province_ownership().get_nation() != sel_nation)
233 || !(abm.get_province().get_nation_from_province_ownership()))
234 continue;
235 total = economy::state_factory_count(state, sid, abm.get_province().get_nation_from_province_ownership());
236 float value = float(total) / float(max_total);
238 auto i = province::to_map_id(abm.get_province());
239 prov_color[i] = color;
240 prov_color[i + texture_size] = color;
241 }
242 });
243 return prov_color;
244}
245
246std::vector<uint32_t> con_map_from(sys::state& state) {
247 uint32_t province_size = state.world.province_size();
248 uint32_t texture_size = province_size + 256 - province_size % 256;
249 std::vector<uint32_t> prov_color(texture_size * 2);
250 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
251 state.world.for_each_province([&](dcon::province_id prov_id) {
252 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
253 if((sel_nation && nation == sel_nation) || !sel_nation) {
254 auto scale = 1.f / 10.f;
255 auto value = scale * (state.world.province_get_demographics(prov_id, demographics::consciousness) / state.world.province_get_demographics(prov_id, demographics::total));
256 uint32_t color = ogl::color_gradient_magma(value);
257 auto i = province::to_map_id(prov_id);
258 prov_color[i] = color;
259 prov_color[i + texture_size] = color;
260 }
261 });
262 return prov_color;
263}
264
265std::vector<uint32_t> literacy_map_from(sys::state& state) {
266 uint32_t province_size = state.world.province_size();
267 uint32_t texture_size = province_size + 256 - province_size % 256;
268 std::vector<uint32_t> prov_color(texture_size * 2);
269 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
270 state.world.for_each_province([&](dcon::province_id prov_id) {
271 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
272 if((sel_nation && nation == sel_nation) || !sel_nation) {
273 auto value = (state.world.province_get_demographics(prov_id, demographics::literacy) / state.world.province_get_demographics(prov_id, demographics::total));
275 auto i = province::to_map_id(prov_id);
276 prov_color[i] = color;
277 prov_color[i + texture_size] = color;
278 }
279 });
280 return prov_color;
281}
282std::vector<uint32_t> growth_map_from(sys::state& state) {
283 std::vector<float> prov_population_change(state.world.province_size() + 1);
284 std::unordered_map<int32_t, float> continent_max_growth = {};
285 std::unordered_map<int32_t, float> continent_min_growth = {};
286 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
287 state.world.for_each_province([&](dcon::province_id prov_id) {
288 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
289 if((sel_nation && nation == sel_nation) || !sel_nation) {
290 auto fat_id = dcon::fatten(state.world, prov_id);
291 float population_change = float(demographics::get_monthly_pop_increase(state, prov_id));
292 auto cid = fat_id.get_continent().id.index();
293 continent_max_growth[cid] = std::max(continent_max_growth[cid], population_change);
294 continent_min_growth[cid] = std::min(continent_min_growth[cid], population_change);
295 auto i = province::to_map_id(prov_id);
296 prov_population_change[i] = population_change;
297 }
298 });
299 uint32_t province_size = state.world.province_size() + 1;
300 uint32_t texture_size = province_size + 256 - province_size % 256;
301 std::vector<uint32_t> prov_color(texture_size * 2);
302 state.world.for_each_province([&](dcon::province_id prov_id) {
303 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
304 if((sel_nation && nation == sel_nation) || !sel_nation) {
305 auto fat_id = dcon::fatten(state.world, prov_id);
306 auto cid = fat_id.get_continent().id.index();
307 auto i = province::to_map_id(prov_id);
308 auto color = sys::pack_color(232, 228, 111); // yellow
309 if(prov_population_change[i] > 0.f) {
310 float gradient_index = (continent_max_growth[cid] == 0.f ? 0.f : (prov_population_change[i] / continent_max_growth[cid]));
311 color = ogl::color_gradient(gradient_index,
312 sys::pack_color(46, 247, 15), // green
313 sys::pack_color(232, 228, 111) // yellow
314 );
315 } else if(prov_population_change[i] < 0.f) {
316 float gradient_index = (continent_min_growth[cid] == 0.f ? 0.f : (prov_population_change[i] / continent_min_growth[cid]));
317 color = ogl::color_gradient(gradient_index,
318 sys::pack_color(247, 15, 15), // red
319 sys::pack_color(232, 228, 111) // yellow
320 );
321 }
322 prov_color[i] = color;
323 prov_color[i + texture_size] = color;
324 }
325 });
326 return prov_color;
327}
328std::vector<uint32_t> income_map_from(sys::state& state) {
329 std::vector<float> prov_population(state.world.province_size() + 1);
330 std::unordered_map<int32_t, float> continent_max_pop = {};
331 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
332 state.world.for_each_province([&](dcon::province_id prov_id) {
333 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
334 if((sel_nation && nation == sel_nation) || !sel_nation) {
335 auto fat_id = dcon::fatten(state.world, prov_id);
336 float population = 0.f;
337 for(const auto pl : state.world.province_get_pop_location_as_province(prov_id))
338 population += pl.get_pop().get_savings();
339 auto cid = fat_id.get_continent().id.index();
340 continent_max_pop[cid] = std::max(continent_max_pop[cid], population);
341 auto i = province::to_map_id(prov_id);
342 prov_population[i] = population;
343 }
344 });
345 uint32_t province_size = state.world.province_size() + 1;
346 uint32_t texture_size = province_size + 256 - province_size % 256;
347 std::vector<uint32_t> prov_color(texture_size * 2);
348 state.world.for_each_province([&](dcon::province_id prov_id) {
349 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
350 if((sel_nation && nation == sel_nation) || !sel_nation) {
351 auto fat_id = dcon::fatten(state.world, prov_id);
352 auto cid = fat_id.get_continent().id.index();
353 auto i = province::to_map_id(prov_id);
354 float gradient_index = 1.f - (prov_population[i] / continent_max_pop[cid]);
355 auto color = ogl::color_gradient(gradient_index, 210, 100 << 8);
356 prov_color[i] = color;
357 prov_color[i + texture_size] = color;
358 }
359 });
360 return prov_color;
361}
362std::vector<uint32_t> employment_map_from(sys::state& state) {
363 uint32_t province_size = state.world.province_size();
364 uint32_t texture_size = province_size + 256 - province_size % 256;
365 std::vector<uint32_t> prov_color(texture_size * 2);
366 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
367 state.world.for_each_province([&](dcon::province_id prov_id) {
368 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
369 if((sel_nation && nation == sel_nation) || !sel_nation) {
370 auto value = state.world.province_get_demographics(prov_id, demographics::employed) / state.world.province_get_demographics(prov_id, demographics::employable);
371 uint32_t color = ogl::color_gradient(value,
372 sys::pack_color(46, 247, 15), // green
373 sys::pack_color(247, 15, 15) // red
374 );
375 auto i = province::to_map_id(prov_id);
376 prov_color[i] = color;
377 prov_color[i + texture_size] = color;
378 }
379 });
380 return prov_color;
381}
382
383std::vector<uint32_t> militancy_map_from(sys::state& state) {
384 uint32_t province_size = state.world.province_size();
385 uint32_t texture_size = province_size + 256 - province_size % 256;
386
387 std::vector<uint32_t> prov_color(texture_size * 2);
388 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
389 state.world.for_each_province([&](dcon::province_id prov_id) {
390 auto fat_id = dcon::fatten(state.world, prov_id);
391 auto nation = fat_id.get_nation_from_province_ownership();
392 if((sel_nation && nation == sel_nation) || !sel_nation) {
393 float revolt_risk = province::revolt_risk(state, prov_id) / 10;
394 uint32_t color = ogl::color_gradient_magma(revolt_risk);
395 auto i = province::to_map_id(prov_id);
396 prov_color[i] = color;
397 prov_color[i + texture_size] = color;
398 }
399 });
400 return prov_color;
401}
402
403//
404// Even newer mapmodes!
405//
406std::vector<uint32_t> life_needs_map_from(sys::state& state) {
407 std::vector<float> prov_satisfaction(state.world.province_size() + 1);
408 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
409 state.world.for_each_province([&](dcon::province_id prov_id) {
410 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
411 if((sel_nation && nation == sel_nation) || !sel_nation) {
412 auto fat_id = dcon::fatten(state.world, prov_id);
413 float population = 0.f;
414 for(const auto pl : state.world.province_get_pop_location_as_province(prov_id))
415 population += pop_demographics::get_life_needs(state, pl.get_pop()) * pl.get_pop().get_size();
416 auto cid = fat_id.get_continent().id.index();
417 auto i = province::to_map_id(prov_id);
418 prov_satisfaction[i] = population / state.world.province_get_demographics(prov_id, demographics::total);
419 }
420 });
421 uint32_t province_size = state.world.province_size() + 1;
422 uint32_t texture_size = province_size + 256 - province_size % 256;
423 std::vector<uint32_t> prov_color(texture_size * 2);
424 state.world.for_each_province([&](dcon::province_id prov_id) {
425 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
426 if((sel_nation && nation == sel_nation) || !sel_nation) {
427 auto fat_id = dcon::fatten(state.world, prov_id);
428 auto cid = fat_id.get_continent().id.index();
429 auto i = province::to_map_id(prov_id);
430 auto color = ogl::color_gradient_viridis(prov_satisfaction[i]);
431 prov_color[i] = color;
432 prov_color[i + texture_size] = color;
433 }
434 });
435 return prov_color;
436}
437std::vector<uint32_t> everyday_needs_map_from(sys::state& state) {
438 std::vector<float> prov_satisfaction(state.world.province_size() + 1);
439 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
440 state.world.for_each_province([&](dcon::province_id prov_id) {
441 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
442 if((sel_nation && nation == sel_nation) || !sel_nation) {
443 auto fat_id = dcon::fatten(state.world, prov_id);
444 float population = 0.f;
445 for(const auto pl : state.world.province_get_pop_location_as_province(prov_id))
446 population += pop_demographics::get_everyday_needs(state, pl.get_pop()) * pl.get_pop().get_size();
447 auto cid = fat_id.get_continent().id.index();
448 auto i = province::to_map_id(prov_id);
449 prov_satisfaction[i] = population / state.world.province_get_demographics(prov_id, demographics::total);
450 }
451 });
452 uint32_t province_size = state.world.province_size() + 1;
453 uint32_t texture_size = province_size + 256 - province_size % 256;
454 std::vector<uint32_t> prov_color(texture_size * 2);
455 state.world.for_each_province([&](dcon::province_id prov_id) {
456 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
457 if((sel_nation && nation == sel_nation) || !sel_nation) {
458 auto fat_id = dcon::fatten(state.world, prov_id);
459 auto cid = fat_id.get_continent().id.index();
460 auto i = province::to_map_id(prov_id);
461 float gradient_index = prov_satisfaction[i];
462 auto color = ogl::color_gradient_viridis(gradient_index);
463 prov_color[i] = color;
464 prov_color[i + texture_size] = color;
465 }
466 });
467 return prov_color;
468}
469std::vector<uint32_t> luxury_needs_map_from(sys::state& state) {
470 std::vector<float> prov_satisfaction(state.world.province_size() + 1);
471 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
472 state.world.for_each_province([&](dcon::province_id prov_id) {
473 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
474 if((sel_nation && nation == sel_nation) || !sel_nation) {
475 auto fat_id = dcon::fatten(state.world, prov_id);
476 float population = 0.f;
477 for(const auto pl : state.world.province_get_pop_location_as_province(prov_id))
478 population += pop_demographics::get_luxury_needs(state, pl.get_pop()) * pl.get_pop().get_size();
479 auto cid = fat_id.get_continent().id.index();
480 auto i = province::to_map_id(prov_id);
481 prov_satisfaction[i] = population / state.world.province_get_demographics(prov_id, demographics::total);
482 }
483 });
484 uint32_t province_size = state.world.province_size() + 1;
485 uint32_t texture_size = province_size + 256 - province_size % 256;
486 std::vector<uint32_t> prov_color(texture_size * 2);
487 state.world.for_each_province([&](dcon::province_id prov_id) {
488 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
489 if((sel_nation && nation == sel_nation) || !sel_nation) {
490 auto fat_id = dcon::fatten(state.world, prov_id);
491 auto cid = fat_id.get_continent().id.index();
492 auto i = province::to_map_id(prov_id);
493 auto color = ogl::color_gradient_viridis(prov_satisfaction[i]);
494 prov_color[i] = color;
495 prov_color[i + texture_size] = color;
496 }
497 });
498 return prov_color;
499}
500std::vector<uint32_t> life_rating_map_from(sys::state& state) {
501 std::vector<float> prov_population(state.world.province_size() + 1);
502 std::unordered_map<int32_t, float> continent_max_pop = {};
503 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
504 state.world.for_each_province([&](dcon::province_id prov_id) {
505 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
506 if((sel_nation && nation == sel_nation) || !sel_nation) {
507 auto fat_id = dcon::fatten(state.world, prov_id);
508 auto cid = fat_id.get_continent().id.index();
509 continent_max_pop[cid] = std::max(continent_max_pop[cid], float(fat_id.get_life_rating()));
510 auto i = province::to_map_id(prov_id);
511 prov_population[i] = float(fat_id.get_life_rating());
512 }
513 });
514 uint32_t province_size = state.world.province_size() + 1;
515 uint32_t texture_size = province_size + 256 - province_size % 256;
516 std::vector<uint32_t> prov_color(texture_size * 2);
517 state.world.for_each_province([&](dcon::province_id prov_id) {
518 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
519 if((sel_nation && nation == sel_nation) || !sel_nation) {
520 auto fat_id = dcon::fatten(state.world, prov_id);
521 auto cid = fat_id.get_continent().id.index();
522 auto i = province::to_map_id(prov_id);
523 float gradient_index = prov_population[i] / continent_max_pop[cid];
524 auto color = ogl::color_gradient_viridis(gradient_index);
525 prov_color[i] = color;
526 prov_color[i + texture_size] = color;
527 }
528 });
529 return prov_color;
530}
531std::vector<uint32_t> officers_map_from(sys::state& state) {
532 std::vector<float> prov_population(state.world.province_size() + 1);
533 std::unordered_map<int32_t, float> continent_max_pop = {};
534 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
535 state.world.for_each_province([&](dcon::province_id prov_id) {
536 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
537 if((sel_nation && nation == sel_nation) || !sel_nation) {
538 auto fat_id = dcon::fatten(state.world, prov_id);
539 auto cid = fat_id.get_continent().id.index();
540 float total_officers = fat_id.get_demographics(demographics::to_key(state, state.culture_definitions.officers));
541 continent_max_pop[cid] = std::max(continent_max_pop[cid], total_officers);
542 auto i = province::to_map_id(prov_id);
543 prov_population[i] = total_officers;
544 }
545 });
546 uint32_t province_size = state.world.province_size() + 1;
547 uint32_t texture_size = province_size + 256 - province_size % 256;
548 std::vector<uint32_t> prov_color(texture_size * 2);
549 state.world.for_each_province([&](dcon::province_id prov_id) {
550 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
551 if((sel_nation && nation == sel_nation) || !sel_nation) {
552 auto fat_id = dcon::fatten(state.world, prov_id);
553 auto cid = fat_id.get_continent().id.index();
554 auto i = province::to_map_id(prov_id);
555 float gradient_index = 1.f - (prov_population[i] / continent_max_pop[cid]);
556 auto color = ogl::color_gradient(gradient_index, 210, 100 << 8);
557 prov_color[i] = color;
558 prov_color[i + texture_size] = color;
559 }
560 });
561 return prov_color;
562}
563std::vector<uint32_t> ctc_map_from(sys::state& state) {
564 uint32_t province_size = state.world.province_size();
565 uint32_t texture_size = province_size + 256 - province_size % 256;
566 std::vector<uint32_t> prov_color(texture_size * 2);
567 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
568 state.world.for_each_province([&](dcon::province_id prov_id) {
569 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
570 if((sel_nation && nation == sel_nation) || !sel_nation) {
571 auto total_pw = state.world.province_get_demographics(prov_id, demographics::to_key(state, state.culture_definitions.primary_factory_worker));
572 auto total_sw = state.world.province_get_demographics(prov_id, demographics::to_key(state, state.culture_definitions.secondary_factory_worker));
573 auto total = total_pw + total_sw;
574 auto value = (total_pw == 0.f || total_sw == 0.f) ? 0.f : total_pw / (total_pw + total_sw);
575 value = 1.f - (state.economy_definitions.craftsmen_fraction - value);
576 uint32_t color = ogl::color_gradient(value,
577 sys::pack_color(46, 247, 15), // green
578 sys::pack_color(247, 15, 15) // red
579 );
580 auto i = province::to_map_id(prov_id);
581 prov_color[i] = color;
582 prov_color[i + texture_size] = color;
583 }
584 });
585 return prov_color;
586}
587std::vector<uint32_t> crime_map_from(sys::state& state) {
588 uint32_t province_size = state.world.province_size();
589 uint32_t texture_size = province_size + 256 - province_size % 256;
590 std::vector<uint32_t> prov_color(texture_size * 2);
591 state.world.for_each_province([&](dcon::province_id prov_id) {
592 dcon::crime_id cmp_crime;
593 if(state.map_state.get_selected_province()) {
594 cmp_crime = state.world.province_get_crime(state.map_state.get_selected_province());
595 }
596 auto i = province::to_map_id(prov_id);
597 if(auto crime = state.world.province_get_crime(prov_id); crime && (!cmp_crime || crime == cmp_crime)) {
598 prov_color[i] = ogl::get_ui_color(state, crime);
599 prov_color[i + texture_size] = ogl::get_ui_color(state, crime);
600 } else {
601 prov_color[i] = 0;
602 prov_color[i + texture_size] = 0;
603 }
604 });
605 return prov_color;
606}
607std::vector<uint32_t> rally_map_from(sys::state& state) {
608 uint32_t province_size = state.world.province_size();
609 uint32_t texture_size = province_size + 256 - province_size % 256;
610 std::vector<uint32_t> prov_color(texture_size * 2);
611 state.world.for_each_province([&](dcon::province_id prov_id) {
612 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
613 auto i = province::to_map_id(prov_id);
614 prov_color[i] = state.world.province_get_land_rally_point(prov_id) ? sys::pack_color(46, 247, 15) : 0;
615 prov_color[i + texture_size] = state.world.province_get_naval_rally_point(prov_id) ? sys::pack_color(46, 15, 247) : 0;
616 });
617 return prov_color;
618}
619std::vector<uint32_t> mobilization_map_from(sys::state& state) {
620 std::vector<float> prov_population(state.world.province_size() + 1);
621 std::unordered_map<int32_t, float> continent_max_pop = {};
622 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
623 state.world.for_each_province([&](dcon::province_id prov_id) {
624 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
625 if((sel_nation && nation == sel_nation) || !sel_nation) {
626 auto fat_id = dcon::fatten(state.world, prov_id);
627 auto cid = fat_id.get_continent().id.index();
628 float total_regs = float(military::regiments_max_possible_from_province(state, prov_id));
629 continent_max_pop[cid] = std::max(continent_max_pop[cid], total_regs);
630 auto i = province::to_map_id(prov_id);
631 prov_population[i] = total_regs;
632 }
633 });
634 uint32_t province_size = state.world.province_size() + 1;
635 uint32_t texture_size = province_size + 256 - province_size % 256;
636 std::vector<uint32_t> prov_color(texture_size * 2);
637 state.world.for_each_province([&](dcon::province_id prov_id) {
638 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
639 if((sel_nation && nation == sel_nation) || !sel_nation) {
640 auto fat_id = dcon::fatten(state.world, prov_id);
641 auto cid = fat_id.get_continent().id.index();
642 auto i = province::to_map_id(prov_id);
643 if(prov_population[i] == 0.f) {
644 auto color = sys::pack_color(0, 0, 0);
645 prov_color[i] = color;
646 prov_color[i + texture_size] = color;
647 } else {
648 float gradient_index = 1.f - (prov_population[i] / continent_max_pop[cid]);
649 auto color = ogl::color_gradient(gradient_index, 210, 100 << 8);
650 prov_color[i] = color;
651 prov_color[i + texture_size] = color;
652 }
653 }
654 });
655 return prov_color;
656}
657std::vector<uint32_t> workforce_map_from(sys::state& state) {
658 uint32_t province_size = state.world.province_size() + 1;
659 uint32_t texture_size = province_size + 256 - province_size % 256;
660 std::vector<uint32_t> prov_color(texture_size * 2);
661 if(state.map_state.get_selected_province()) {
662 dcon::pop_type_fat_id fat_id = dcon::fatten(state.world, dcon::pop_type_id{});
663 float pt_max = 0.f;
664 for(const auto pt : state.world.in_pop_type) {
665 auto total = state.world.province_get_demographics(state.map_state.get_selected_province(), demographics::to_key(state, pt));
666 if(total > pt_max) {
667 fat_id = pt;
668 total = pt_max;
669 }
670 }
671 if(bool(fat_id)) {
672 uint32_t full_color = fat_id.get_color();
673 uint32_t empty_color = 0xDDDDDD;
674 // Make the other end of the gradient dark if the color is bright and vice versa.
675 if((full_color & 0xFF) + (full_color >> 8 & 0xFF) + (full_color >> 16 & 0xFF) > 140 * 3) {
676 empty_color = 0x222222;
677 }
678 state.world.for_each_province([&](dcon::province_id prov_id) {
679 auto i = province::to_map_id(prov_id);
680 float total = state.world.province_get_demographics(state.map_state.get_selected_province(), demographics::total);
681 float value = state.world.province_get_demographics(state.map_state.get_selected_province(), demographics::to_key(state, fat_id));
682 auto ratio = value / total;
683 auto color = ogl::color_gradient(ratio, full_color, empty_color);
684 prov_color[i] = color;
685 prov_color[i + texture_size] = color;
686 });
687 }
688 } else {
689 state.world.for_each_province([&](dcon::province_id prov_id) {
690 auto id = province::to_map_id(prov_id);
691 float total_pops = state.world.province_get_demographics(prov_id, demographics::total);
692 dcon::pop_type_id primary_id;
693 dcon::pop_type_id secondary_id;
694 float primary_percent = 0.f;
695 float secondary_percent = 0.f;
696 state.world.for_each_pop_type([&](dcon::pop_type_id id) {
697 float volume = 0.f;
698 for(const auto pl : state.world.province_get_pop_location_as_province(prov_id)) {
699 if(pl.get_pop().get_poptype() == id) {
700 volume += pl.get_pop().get_size();
701 }
702 }
703 float percent = volume / total_pops;
704 if(percent > primary_percent) {
705 secondary_id = primary_id;
706 secondary_percent = primary_percent;
707 primary_id = id;
708 primary_percent = percent;
709 } else if(percent > secondary_percent) {
710 secondary_id = id;
711 secondary_percent = percent;
712 }
713 });
714 uint32_t primary_color = dcon::fatten(state.world, primary_id).get_color();
715 uint32_t secondary_color = 0xFFAAAAAA; // This color won't be reached
716 if(bool(secondary_id)) {
717 secondary_color = dcon::fatten(state.world, secondary_id).get_color();
718 }
719 if(secondary_percent >= primary_percent * 0.75f) {
720 prov_color[id] = primary_color;
721 prov_color[id + texture_size] = secondary_color;
722 } else {
723 prov_color[id] = primary_color;
724 prov_color[id + texture_size] = primary_color;
725 }
726 });
727 }
728 return prov_color;
729}
730std::vector<uint32_t> players_map_from(sys::state& state) {
731 uint32_t province_size = state.world.province_size() + 1;
732 uint32_t texture_size = province_size + 256 - province_size % 256;
733 std::vector<uint32_t> prov_color(texture_size * 2);
734 for(const auto n : state.world.in_nation) {
735 if(n.get_is_player_controlled()) {
736 for(const auto po : state.world.nation_get_province_ownership_as_nation(n)) {
737 auto id = province::to_map_id(po.get_province());
738 prov_color[id] = n.get_color();
739 }
740 for(const auto po : state.world.nation_get_province_control_as_nation(n)) {
741 auto id = province::to_map_id(po.get_province());
742 prov_color[id + texture_size] = n.get_color();
743 }
744 }
745 }
746 return prov_color;
747}
748
749#include "gui_element_types.hpp"
750
751std::vector<uint32_t> select_states_map_from(sys::state& state) {
752 uint32_t province_size = state.world.province_size();
753 uint32_t texture_size = province_size + 256 - province_size % 256;
754 std::vector<uint32_t> prov_color(texture_size * 2, 0);
755
756 assert(state.state_selection.has_value());
757 if(state.state_selection) {
758 for(const auto s : state.state_selection->selectable_states) {
759 uint32_t color = ogl::color_from_hash(s.index());
760
761 for(const auto m : state.world.state_definition_get_abstract_state_membership_as_state(s)) {
762 auto p = m.get_province();
763
764 auto i = province::to_map_id(p.id);
765
766 prov_color[i] = color;
767 prov_color[i + texture_size] = ~color;
768 }
769 }
770 }
771 return prov_color;
772}
773
774namespace map_mode {
775
777 std::vector<uint32_t> prov_color;
778 switch(mode) {
786 //New mapmodes
800 if(state.ui_state.map_gradient_legend)
801 state.ui_state.map_gradient_legend->set_visible(state, true);
802 break;
803 default:
804 if(state.ui_state.map_gradient_legend)
805 state.ui_state.map_gradient_legend->set_visible(state, false);
806 break;
807 }
809 if(state.ui_state.map_civ_level_legend)
810 state.ui_state.map_civ_level_legend->set_visible(state, true);
811 } else {
812 if(state.ui_state.map_civ_level_legend)
813 state.ui_state.map_civ_level_legend->set_visible(state, false);
814 }
815 if(mode == mode::colonial) {
816 if(state.ui_state.map_col_legend)
817 state.ui_state.map_col_legend->set_visible(state, true);
818 } else {
819 if(state.ui_state.map_col_legend)
820 state.ui_state.map_col_legend->set_visible(state, false);
821 }
822 if(mode == mode::diplomatic) {
823 if(state.ui_state.map_dip_legend)
824 state.ui_state.map_dip_legend->set_visible(state, true);
825 } else {
826 if(state.ui_state.map_dip_legend)
827 state.ui_state.map_dip_legend->set_visible(state, false);
828 }
830 if(state.ui_state.map_rr_legend)
831 state.ui_state.map_rr_legend->set_visible(state, true);
832 } else {
833 if(state.ui_state.map_rr_legend)
834 state.ui_state.map_rr_legend->set_visible(state, false);
835 }
836 if(mode == mode::naval) {
837 if(state.ui_state.map_nav_legend)
838 state.ui_state.map_nav_legend->set_visible(state, true);
839 } else {
840 if(state.ui_state.map_nav_legend)
841 state.ui_state.map_nav_legend->set_visible(state, false);
842 }
843 if(mode == mode::rank) {
844 if(state.ui_state.map_rank_legend)
845 state.ui_state.map_rank_legend->set_visible(state, true);
846 } else {
847 if(state.ui_state.map_rank_legend)
848 state.ui_state.map_rank_legend->set_visible(state, false);
849 }
850 if(mode == mode::recruitment) {
851 if(state.ui_state.map_rec_legend)
852 state.ui_state.map_rec_legend->set_visible(state, true);
853 } else {
854 if(state.ui_state.map_rec_legend)
855 state.ui_state.map_rec_legend->set_visible(state, false);
856 }
857
858 switch(mode) {
860 prov_color = select_states_map_from(state);
861 break;
862 case mode::terrain:
863 state.map_state.set_terrain_map_mode();
864 return;
865 case mode::political:
866 prov_color = political_map_from(state);
867 break;
868 case mode::region:
869 prov_color = region_map_from(state);
870 break;
871 case mode::population:
872 prov_color = population_map_from(state);
873 break;
875 prov_color = nationality_map_from(state);
876 break;
877 case mode::sphere:
878 prov_color = sphere_map_from(state);
879 break;
880 case mode::diplomatic:
881 prov_color = diplomatic_map_from(state);
882 break;
883 case mode::rank:
884 prov_color = rank_map_from(state);
885 break;
887 prov_color = recruitment_map_from(state);
888 break;
889 case mode::supply:
890 prov_color = supply_map_from(state);
891 break;
892 case mode::relation:
893 prov_color = relation_map_from(state);
894 break;
896 prov_color = civilization_level_map_from(state);
897 break;
898 case mode::migration:
899 prov_color = migration_map_from(state);
900 break;
902 prov_color = infrastructure_map_from(state);
903 break;
904 case mode::revolt:
905 prov_color = revolt_map_from(state);
906 break;
908 prov_color = party_loyalty_map_from(state);
909 break;
910 case mode::admin:
911 prov_color = admin_map_from(state);
912 break;
913 case mode::naval:
914 prov_color = naval_map_from(state);
915 break;
917 prov_color = national_focus_map_from(state);
918 break;
919 case mode::crisis:
920 prov_color = crisis_map_from(state);
921 break;
922 case mode::colonial:
923 prov_color = colonial_map_from(state);
924 break;
925 case mode::rgo_output:
926 prov_color = rgo_output_map_from(state);
927 break;
928 case mode::religion:
929 prov_color = religion_map_from(state);
930 break;
931 case mode::issues:
932 prov_color = issue_map_from(state);
933 break;
934 case mode::ideology:
935 prov_color = ideology_map_from(state);
936 break;
937 case mode::fort:
938 prov_color = fort_map_from(state);
939 break;
940 case mode::income:
941 prov_color = income_map_from(state);
942 break;
944 prov_color = con_map_from(state);
945 break;
946 case mode::militancy:
947 prov_color = militancy_map_from(state);
948 break;
949 case mode::literacy:
950 prov_color = literacy_map_from(state);
951 break;
952 case mode::employment:
953 prov_color = employment_map_from(state);
954 break;
955 case mode::factories:
956 prov_color = factory_map_from(state);
957 break;
958 case mode::growth:
959 prov_color = growth_map_from(state);
960 break;
961 //even newer mapmodes
962 case mode::players:
963 prov_color = players_map_from(state);
964 break;
965 case mode::life_needs:
966 prov_color = life_needs_map_from(state);
967 break;
969 prov_color = everyday_needs_map_from(state);
970 break;
972 prov_color = luxury_needs_map_from(state);
973 break;
975 prov_color = life_rating_map_from(state);
976 break;
978 prov_color = ctc_map_from(state);
979 break;
980 case mode::crime:
981 prov_color = crime_map_from(state);
982 break;
983 case mode::rally:
984 prov_color = rally_map_from(state);
985 break;
986 case mode::officers:
987 prov_color = officers_map_from(state);
988 break;
990 prov_color = mobilization_map_from(state);
991 break;
992 case mode::workforce:
993 prov_color = workforce_map_from(state);
994 break;
995 default:
996 return;
997 }
998 state.map_state.set_province_color(prov_color, mode);
999}
1000
1002 if(state.map_state.active_map_mode == mode::terrain || state.map_state.active_map_mode == mode::region) {
1003 return;
1004 }
1005 set_map_mode(state, state.map_state.active_map_mode);
1006}
1007} // namespace map_mode
std::vector< uint32_t > admin_map_from(sys::state &state)
Definition: admin.hpp:3
std::vector< uint32_t > civilization_level_map_from(sys::state &state)
std::vector< uint32_t > colonial_map_from(sys::state &state)
Definition: colonial.hpp:2
std::vector< uint32_t > crisis_map_from(sys::state &state)
Definition: crisis.hpp:2
#define assert(condition)
Definition: debug.h:74
std::vector< uint32_t > diplomatic_map_from(sys::state &state)
Definition: diplomatic.hpp:131
std::vector< uint32_t > infrastructure_map_from(sys::state &state)
std::vector< uint32_t > growth_map_from(sys::state &state)
Definition: map_modes.cpp:282
std::vector< uint32_t > issue_map_from(sys::state &state)
Definition: map_modes.cpp:104
std::vector< uint32_t > con_map_from(sys::state &state)
Definition: map_modes.cpp:246
std::vector< uint32_t > ctc_map_from(sys::state &state)
Definition: map_modes.cpp:563
std::vector< uint32_t > rally_map_from(sys::state &state)
Definition: map_modes.cpp:607
std::vector< uint32_t > ideology_map_from(sys::state &state)
Definition: map_modes.cpp:37
std::vector< uint32_t > life_needs_map_from(sys::state &state)
Definition: map_modes.cpp:406
std::vector< uint32_t > factory_map_from(sys::state &state)
Definition: map_modes.cpp:204
std::vector< uint32_t > crime_map_from(sys::state &state)
Definition: map_modes.cpp:587
std::vector< uint32_t > income_map_from(sys::state &state)
Definition: map_modes.cpp:328
std::vector< uint32_t > luxury_needs_map_from(sys::state &state)
Definition: map_modes.cpp:469
std::vector< uint32_t > select_states_map_from(sys::state &state)
Definition: map_modes.cpp:751
std::vector< uint32_t > life_rating_map_from(sys::state &state)
Definition: map_modes.cpp:500
std::vector< uint32_t > everyday_needs_map_from(sys::state &state)
Definition: map_modes.cpp:437
std::vector< uint32_t > employment_map_from(sys::state &state)
Definition: map_modes.cpp:362
std::vector< uint32_t > mobilization_map_from(sys::state &state)
Definition: map_modes.cpp:619
std::vector< uint32_t > fort_map_from(sys::state &state)
Definition: map_modes.cpp:171
std::vector< uint32_t > players_map_from(sys::state &state)
Definition: map_modes.cpp:730
std::vector< uint32_t > workforce_map_from(sys::state &state)
Definition: map_modes.cpp:657
std::vector< uint32_t > militancy_map_from(sys::state &state)
Definition: map_modes.cpp:383
std::vector< uint32_t > literacy_map_from(sys::state &state)
Definition: map_modes.cpp:265
std::vector< uint32_t > officers_map_from(sys::state &state)
Definition: map_modes.cpp:531
std::vector< uint32_t > migration_map_from(sys::state &state)
Definition: migration.hpp:3
pop_satisfaction_wrapper_fat fatten(data_container const &c, pop_satisfaction_wrapper_id id) noexcept
constexpr dcon::demographics_key total(0)
dcon::demographics_key to_key(sys::state const &state, dcon::pop_type_id v)
constexpr dcon::demographics_key employable(1)
constexpr dcon::demographics_key consciousness(3)
constexpr dcon::demographics_key employed(2)
float get_monthly_pop_increase(sys::state &state, dcon::pop_id ids)
constexpr dcon::demographics_key literacy(5)
int32_t state_factory_count(sys::state &state, dcon::state_instance_id sid, dcon::nation_id n)
Definition: economy.cpp:8347
void update_map_mode(sys::state &state)
Definition: map_modes.cpp:1001
void set_map_mode(sys::state &state, mode mode)
Definition: map_modes.cpp:776
int32_t regiments_max_possible_from_province(sys::state &state, dcon::province_id p)
Definition: military.cpp:885
uint32_t color_gradient_magma(float percent)
Definition: color.hpp:568
uint32_t get_ui_color(sys::state &state, T id)
Definition: color.hpp:585
constexpr uint32_t color_from_hash(uint32_t color)
Definition: color.hpp:9
uint32_t color_gradient_viridis(float percent)
Definition: color.hpp:561
uint32_t color_gradient(float percent, uint32_t top_color, uint32_t bot_color)
Definition: color.hpp:575
float get_luxury_needs(sys::state const &state, dcon::pop_id p)
dcon::pop_demographics_key to_key(sys::state const &state, dcon::ideology_id v)
float get_life_needs(sys::state const &state, dcon::pop_id p)
float get_everyday_needs(sys::state const &state, dcon::pop_id p)
float get_demo(sys::state const &state, dcon::pop_id p, dcon::pop_demographics_key k)
bool can_build_fort(sys::state &state, dcon::province_id id, dcon::nation_id n)
Definition: province.cpp:420
bool has_fort_being_built(sys::state &state, dcon::province_id id)
Definition: province.cpp:413
float revolt_risk(sys::state &state, dcon::province_id id)
Definition: province.cpp:611
constexpr uint16_t to_map_id(dcon::province_id id)
Definition: province.hpp:10
uint32_t pack_color(float r, float g, float b)
std::vector< uint32_t > national_focus_map_from(sys::state &state)
std::vector< uint32_t > nationality_map_from(sys::state &state)
Definition: nationality.hpp:88
std::vector< uint32_t > naval_map_from(sys::state &state)
Definition: naval.hpp:5
uint uint32_t
uchar uint8_t
std::vector< uint32_t > party_loyalty_map_from(sys::state &state)
std::vector< uint32_t > political_map_from(sys::state &state)
Definition: political.hpp:13
std::vector< uint32_t > population_map_from(sys::state &state)
Definition: population.hpp:74
std::vector< uint32_t > rank_map_from(sys::state &state)
Definition: rank.hpp:3
std::vector< uint32_t > recruitment_map_from(sys::state &state)
Definition: recruitment.hpp:3
std::vector< uint32_t > region_map_from(sys::state &state)
Definition: region.hpp:3
std::vector< uint32_t > relation_map_from(sys::state &state)
Definition: relation.hpp:3
std::vector< uint32_t > religion_map_from(sys::state &state)
Definition: religion.hpp:84
std::vector< uint32_t > revolt_map_from(sys::state &state)
Definition: revolt.hpp:4
std::vector< uint32_t > rgo_output_map_from(sys::state &state)
Definition: rgo_output.hpp:2
std::vector< uint32_t > sphere_map_from(sys::state &state)
Definition: sphere.hpp:166
Holds important data about the game world, state, and other data regarding windowing,...
std::vector< uint32_t > supply_map_from(sys::state &state)
Definition: supply.hpp:3