Skip to main content

nil_core/world/cheat/
mod.rs

1// Copyright (C) Call of Nil contributors
2// SPDX-License-Identifier: AGPL-3.0-only
3
4mod behavior;
5mod city;
6mod infrastructure;
7mod market;
8mod military;
9mod npc;
10mod player;
11mod resources;
12mod round;
13
14pub use behavior::get_build_steps;
15pub use city::{fill_world, get_city, set_stability, spawn_city};
16pub use infrastructure::{
17  get_academy_recruit_queue,
18  get_academy_recruit_queues,
19  get_all_academy_recruit_queues,
20  get_all_prefecture_build_queues,
21  get_all_stable_recruit_queues,
22  get_infrastructure,
23  get_prefecture_build_queue,
24  get_prefecture_build_queues,
25  get_stable_recruit_queue,
26  get_stable_recruit_queues,
27  get_storage_capacity,
28  set_building_level,
29  set_max_infrastructure,
30};
31pub use market::set_market_fee;
32pub use military::{
33  get_idle_armies_at,
34  get_idle_personnel_at,
35  get_maneuvers,
36  get_maneuvers_of,
37  spawn_personnel,
38};
39pub use npc::{get_ethics, set_bot_ethics, spawn_bot};
40pub use player::{get_player, get_players};
41pub use resources::{
42  get_resources,
43  set_food,
44  set_iron,
45  set_max_food,
46  set_max_iron,
47  set_max_resources,
48  set_max_silo_resources,
49  set_max_stone,
50  set_max_warehouse_resources,
51  set_max_wood,
52  set_resources,
53  set_stone,
54  set_wood,
55};
56pub use round::skip_round;
57
58#[doc(hidden)]
59#[macro_export]
60macro_rules! bail_if_cheats_are_not_allowed {
61  ($world:expr) => {
62    if !$world.config.are_cheats_allowed() {
63      use $crate::error::Error;
64      return Err(Error::CheatingNotAllowed);
65    }
66  };
67}