Skip to main content

nil_core/world/cheat/
city.rs

1// Copyright (C) Call of Nil contributors
2// SPDX-License-Identifier: AGPL-3.0-only
3
4use crate::bail_if_cheats_are_not_allowed;
5use crate::city::Stability;
6use crate::continent::Coord;
7use crate::error::Result;
8use crate::world::World;
9
10impl World {
11  pub fn cheat_set_stability(&mut self, coord: Coord, stability: Stability) -> Result<()> {
12    bail_if_cheats_are_not_allowed!(self);
13    let city = self.city_mut(coord)?;
14    *city.stability_mut() = stability;
15    self.emit_city_updated(coord);
16    Ok(())
17  }
18}