nil_core/world/cheat/
behavior.rs1use crate::bail_if_cheats_are_not_allowed;
5use crate::behavior::build::{BUILD_TEMPLATE, BuildStep};
6use crate::continent::Coord;
7use crate::error::Result;
8use crate::world::World;
9use itertools::Itertools;
10use tap::Pipe;
11
12impl World {
13 pub fn cheat_get_build_steps(&self, coord: Coord) -> Result<Vec<BuildStep>> {
14 bail_if_cheats_are_not_allowed!(self);
15 let infrastructure = self.infrastructure(coord)?;
16 BUILD_TEMPLATE
17 .iter()
18 .filter(|step| !step.is_done(infrastructure))
19 .cloned()
20 .collect_vec()
21 .pipe(Ok)
22 }
23}