Trait screeps::objects::StructureProperties
source · pub unsafe trait StructureProperties: RoomObjectProperties + HasId {
fn structure_type(&self) -> StructureType { ... }
fn destroy(&self) -> ReturnCode { ... }
fn is_active(&self) -> bool { ... }
fn notify_when_attacked(&self, notify_when_attacked: bool) -> ReturnCode { ... }
fn as_structure(self) -> Structure { ... }
}
Expand description
Trait for all wrappers over Screeps JavaScript objects extending
the Structure
class.
Contracts
The reference returned by AsRef<Reference>::as_ref
must reference a
JavaScript object extending the Structure
class.
Provided Methods
fn structure_type(&self) -> StructureType
fn destroy(&self) -> ReturnCode
fn is_active(&self) -> bool
sourcefn notify_when_attacked(&self, notify_when_attacked: bool) -> ReturnCode
fn notify_when_attacked(&self, notify_when_attacked: bool) -> ReturnCode
Usable on either owned structures or neutral structures in owned rooms,
returns ReturnCode::NotOwner
otherwise.