screeps/objects/impls/
structure_invader_core.rs

1use wasm_bindgen::prelude::*;
2
3use crate::{
4    objects::{OwnedStructure, RoomObject, Spawning, Structure},
5    prelude::*,
6};
7
8#[wasm_bindgen]
9extern "C" {
10    /// An object representing a [`StructureInvaderCore`], which is at the
11    /// center of NPC strongholds, as well as reserving neutral rooms.
12    ///
13    /// [Screeps documentation](https://docs.screeps.com/api/#StructureInvaderCore)
14    #[wasm_bindgen(extends = RoomObject, extends = Structure, extends = OwnedStructure)]
15    #[derive(Clone, Debug)]
16    pub type StructureInvaderCore;
17
18    /// The level of the [`StructureInvaderCore`]; 0 is a lesser invader core
19    /// that simply reserves rooms, while levels 1-5 are strongholds which
20    /// defend themselves.
21    ///
22    /// [Screeps documentation](https://docs.screeps.com/api/#StructureInvaderCore.level)
23    #[wasm_bindgen(method, getter)]
24    pub fn level(this: &StructureInvaderCore) -> u8;
25
26    /// The number of ticks until the [`StructureInvaderCore`] is fully deployed
27    /// and can be attacked.
28    ///
29    /// [Screeps documentation](https://docs.screeps.com/api/#StructureInvaderCore.ticksToDeploy)
30    #[wasm_bindgen(method, getter = ticksToDeploy)]
31    pub fn ticks_to_deploy(this: &StructureInvaderCore) -> u32;
32
33    /// Information about the spawning creep, if one is currently being spawned.
34    ///
35    /// [Screeps documentation](https://docs.screeps.com/api/#StructureInvaderCore.spawning)
36    #[wasm_bindgen(method, getter)]
37    pub fn spawning(this: &StructureInvaderCore) -> Option<Spawning>;
38}
39
40impl Attackable for StructureInvaderCore {}