Struct screeps::objects::Room [−][src]
Implementations
impl Room
[src]
pub fn controller(&self) -> Option<StructureController>
[src]
pub fn energy_available(&self) -> u32
[src]
pub fn energy_capacity_available(&self) -> u32
[src]
pub fn name(&self) -> RoomName
[src]
pub fn storage(&self) -> Option<StructureStorage>
[src]
pub fn terminal(&self) -> Option<StructureTerminal>
[src]
impl Room
[src]
pub fn serialize_path(&self, path: &[Step]) -> String
[src]
pub fn deserialize_path(&self, path: &str) -> Vec<Step>
[src]
pub fn create_construction_site<T: ?Sized>(
&self,
at: &T,
ty: StructureType
) -> ReturnCode where
T: HasPosition,
[src]
&self,
at: &T,
ty: StructureType
) -> ReturnCode where
T: HasPosition,
pub fn create_named_construction_site<T: ?Sized>(
&self,
at: &T,
ty: StructureType,
name: &str
) -> ReturnCode where
T: HasPosition,
[src]
&self,
at: &T,
ty: StructureType,
name: &str
) -> ReturnCode where
T: HasPosition,
pub fn create_flag<T: ?Sized>(
&self,
at: &T,
name: &str,
main_color: Color,
secondary_color: Color
) -> Result<String, ReturnCode> where
T: HasPosition,
[src]
&self,
at: &T,
name: &str,
main_color: Color,
secondary_color: Color
) -> Result<String, ReturnCode> where
T: HasPosition,
pub fn find<T>(&self, ty: T) -> Vec<T::Item> where
T: FindConstant,
[src]
T: FindConstant,
pub fn find_exit_to(&self, room: &Room) -> Result<ExitDirection, ReturnCode>
[src]
pub fn get_event_log(&self) -> Vec<Event>
[src]
pub fn get_event_log_raw(&self) -> String
[src]
pub fn get_position_at(&self, x: u32, y: u32) -> Option<Position>
[src]
pub fn get_terrain(&self) -> RoomTerrain
[src]
pub fn look_at<T: ?Sized + HasPosition>(&self, target: &T) -> Vec<LookResult>
[src]
pub fn look_at_xy(&self, x: u32, y: u32) -> Vec<LookResult>
[src]
pub fn look_at_area(
&self,
top: u32,
left: u32,
bottom: u32,
right: u32
) -> Vec<PositionedLookResult>
[src]
&self,
top: u32,
left: u32,
bottom: u32,
right: u32
) -> Vec<PositionedLookResult>
pub fn find_path<'a, 's, O: ?Sized, T: ?Sized, F>(
&'s self,
from_pos: &O,
to_pos: &T,
opts: FindOptions<'a, F, SingleRoomCostResult<'a>>
) -> Path where
O: HasPosition,
T: HasPosition,
F: FnMut(RoomName, CostMatrix<'a>) -> SingleRoomCostResult<'a> + 'a + 's,
[src]
&'s self,
from_pos: &O,
to_pos: &T,
opts: FindOptions<'a, F, SingleRoomCostResult<'a>>
) -> Path where
O: HasPosition,
T: HasPosition,
F: FnMut(RoomName, CostMatrix<'a>) -> SingleRoomCostResult<'a> + 'a + 's,
pub fn look_for_at<T, U>(&self, ty: T, target: &U) -> Vec<T::Item> where
T: LookConstant,
U: HasPosition,
[src]
T: LookConstant,
U: HasPosition,
pub fn look_for_at_xy<T>(&self, ty: T, x: u32, y: u32) -> Vec<T::Item> where
T: LookConstant,
[src]
T: LookConstant,
pub fn look_for_at_area<T>(
&self,
ty: T,
horiz: Range<u8>,
vert: Range<u8>
) -> Vec<T::Item> where
T: LookConstant,
[src]
&self,
ty: T,
horiz: Range<u8>,
vert: Range<u8>
) -> Vec<T::Item> where
T: LookConstant,
Looks for a given thing over a given area of bounds.
To keep with Range
convention, the start is inclusive, and the end
is exclusive.
Note: to ease the implementation and efficiency of the rust interface, this is limited to returning an array of values without their positions. If position data is needed, all room objects should contain positions alongside them. (for terrain data, I would recommend using a different method?)
If you really do need more information here, I would recommend making a PR to add it!
Panics
Panics if start>end for either range, or if end>50 for either range.
Examples
use screeps::constants::look; room.look_for_at_area(look::ENERGY, 20..26, 20..26);
pub fn memory(&self) -> MemoryReference
[src]
pub fn name_local(&self) -> RoomName
[src]
pub fn visual(&self) -> RoomVisual
[src]
Trait Implementations
impl AsRef<Reference> for Room
[src]
impl Clone for Room
[src]
impl Eq for Room
[src]
impl FromExpectedType<Reference> for Room
[src]
fn from_expected_type(reference: Reference) -> Result<Self, ConversionError>
[src]
impl InstanceOf for Room
[src]
fn instance_of(reference: &Reference) -> bool
[src]
impl JsSerialize for Room
[src]
impl JsSerializeOwned for Room
[src]
fn into_js_owned<'_a>(value: &'_a mut Option<Self>) -> SerializedValue<'_a>
[src]
impl<'_r> JsSerializeOwned for &'_r Room
[src]
fn into_js_owned<'_a>(value: &'_a mut Option<Self>) -> SerializedValue<'_a>
[src]
impl PartialEq<Room> for Room
[src]
impl ReferenceType for Room
[src]
unsafe fn from_reference_unchecked(reference: Reference) -> Self
[src]
impl<'_r> TryFrom<&'_r Reference> for Room
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(reference: &Reference) -> Result<Self, Self::Error>
[src]
impl<'_r> TryFrom<&'_r Value> for Room
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<Self, Self::Error>
[src]
impl TryFrom<Reference> for Room
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(reference: Reference) -> Result<Self, Self::Error>
[src]
impl TryFrom<Room> for Reference
[src]
type Error = Void
The type returned in the event of a conversion error.
fn try_from(value: Room) -> Result<Self, Self::Error>
[src]
impl TryFrom<Value> for Room
[src]
Auto Trait Implementations
impl RefUnwindSafe for Room
[src]
impl Send for Room
[src]
impl Sync for Room
[src]
impl Unpin for Room
[src]
impl UnwindSafe for Room
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> FromExpectedType<Value> for T where
T: FromExpectedType<Reference>,
[src]
T: FromExpectedType<Reference>,
pub fn from_expected_type(Value) -> Result<T, ConversionError>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> IntoExpectedType<U> for T where
U: FromExpectedType<T>,
[src]
U: FromExpectedType<T>,
pub fn into_expected_type(Self) -> Result<U, ConversionError>
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,