screeps/objects/impls/
structure_rampart.rs1use wasm_bindgen::prelude::*;
2
3use crate::{
4 enums::action_error_codes::structure_rampart::*,
5 objects::{OwnedStructure, RoomObject, Structure},
6 prelude::*,
7};
8
9#[wasm_bindgen]
10extern "C" {
11 #[wasm_bindgen(extends = RoomObject, extends = Structure, extends = OwnedStructure)]
16 #[derive(Clone, Debug)]
17 pub type StructureRampart;
18
19 #[wasm_bindgen(method, getter = isPublic)]
24 pub fn is_public(this: &StructureRampart) -> bool;
25
26 #[wasm_bindgen(method, getter = ticksToDecay)]
34 pub fn ticks_to_decay(this: &StructureRampart) -> u32;
35
36 #[wasm_bindgen(method, js_name = setPublic)]
37 fn set_public_internal(this: &StructureRampart, val: bool) -> i8;
38}
39
40impl StructureRampart {
41 pub fn set_public(&self, public: bool) -> Result<(), SetPublicErrorCode> {
46 SetPublicErrorCode::result_from_i8(self.set_public_internal(public))
47 }
48}
49
50impl CanDecay for StructureRampart {
51 fn ticks_to_decay(&self) -> u32 {
52 Self::ticks_to_decay(self)
53 }
54}
55
56impl Attackable for StructureRampart {}
57impl Dismantleable for StructureRampart {}
58impl Repairable for StructureRampart {}