Project Alice
Loading...
Searching...
No Matches
military_templates.hpp
Go to the documentation of this file.
1#pragma once
2#include "system_state.hpp"
3
4namespace military {
5
6template<typename T>
7auto province_is_blockaded(sys::state const& state, T ids) {
8 return state.world.province_get_is_blockaded(ids);
9}
10
11template<typename T>
12auto province_is_under_siege(sys::state const& state, T ids) {
13 return state.world.province_get_siege_progress(ids) > 0.0f;
14}
15
16template<typename T>
17auto battle_is_ongoing_in_province(sys::state const& state, T ids) {
18 ve::apply(
19 [&](dcon::province_id p) {
20 auto battles = state.world.province_get_land_battle_location(p);
21 return battles.begin() != battles.end();
22 },
23 ids);
24 return false;
25}
26} // namespace military
bool province_is_under_siege(sys::state const &state, dcon::province_id ids)
Definition: military.cpp:453
bool province_is_blockaded(sys::state const &state, dcon::province_id ids)
Definition: military.cpp:422
auto battle_is_ongoing_in_province(sys::state const &state, T ids)