[−][src]Struct screeps::objects::Room
Methods
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) -> String
[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
) -> ReturnCode where
T: HasPosition,
[src]
&self,
at: &T,
name: &str,
main_color: Color,
secondary_color: Color
) -> 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<Exit, 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<RoomPosition>
[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, O: ?Sized, T: ?Sized, F>(
&self,
from_pos: &O,
to_pos: &T,
opts: FindOptions<'a, F>
) -> Path where
O: HasPosition,
T: HasPosition,
F: Fn(String, CostMatrix) -> Option<CostMatrix<'a>> + 'a,
[src]
&self,
from_pos: &O,
to_pos: &T,
opts: FindOptions<'a, F>
) -> Path where
O: HasPosition,
T: HasPosition,
F: Fn(String, CostMatrix) -> Option<CostMatrix<'a>> + 'a,
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) -> LocalRoomName
[src]
Trait Implementations
impl FromExpectedType<Reference> for Room
[src]
fn from_expected_type(reference: Reference) -> Result<Self, ConversionError>
[src]
impl Clone for Room
[src]
fn clone(&self) -> Room
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl From<Room> for Reference
[src]
impl Eq for Room
[src]
impl PartialEq<Room> for Room
[src]
fn eq(&self, other: &Room) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl AsRef<Reference> for Room
[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<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 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<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<'_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 InstanceOf for Room
[src]
fn instance_of(reference: &Reference) -> bool
[src]
impl JsSerialize for Room
[src]
impl ReferenceType for Room
[src]
unsafe fn from_reference_unchecked(reference: Reference) -> Self
[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]
Auto Trait Implementations
Blanket Implementations
impl<T> FromExpectedType for T where
T: FromExpectedType<Reference>,
[src]
T: FromExpectedType<Reference>,
fn from_expected_type(Value) -> Result<T, ConversionError>
[src]
impl<T, U> IntoExpectedType for T where
U: FromExpectedType<T>,
[src]
U: FromExpectedType<T>,
fn into_expected_type(Self) -> Result<U, ConversionError>
[src]
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,