[][src]Struct screeps::objects::Room

pub struct Room(_);

Methods

impl Room[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]

pub fn create_named_construction_site<T: ?Sized>(
    &self,
    at: &T,
    ty: StructureType,
    name: &str
) -> ReturnCode where
    T: HasPosition
[src]

pub fn create_flag<T: ?Sized>(
    &self,
    at: &T,
    name: &str,
    main_color: Color,
    secondary_color: Color
) -> ReturnCode where
    T: HasPosition
[src]

pub fn find<T>(&self, ty: T) -> Vec<T::Item> where
    T: FindConstant
[src]

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]

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]

pub fn look_for_at<T, U>(&self, ty: T, target: &U) -> Vec<T::Item> where
    T: LookConstant,
    U: HasPosition
[src]

pub fn look_for_at_xy<T>(&self, ty: T, x: u32, y: u32) -> Vec<T::Item> where
    T: LookConstant
[src]

pub fn look_for_at_area<T>(
    &self,
    ty: T,
    horiz: Range<u8>,
    vert: Range<u8>
) -> Vec<T::Item> where
    T: LookConstant
[src]

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]

impl Clone for 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]

#[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.

impl TryFrom<Reference> for Room[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl<'_r> TryFrom<&'_r Reference> for Room[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<Value> for Room[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl<'_r> TryFrom<&'_r Value> for Room[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl InstanceOf for Room[src]

impl JsSerialize for Room[src]

impl ReferenceType for Room[src]

impl JsSerializeOwned for Room[src]

impl<'_r> JsSerializeOwned for &'_r Room[src]

Auto Trait Implementations

impl Send for Room

impl Sync for Room

Blanket Implementations

impl<T> FromExpectedType for T where
    T: FromExpectedType<Reference>, 
[src]

impl<T, U> IntoExpectedType for T where
    U: FromExpectedType<T>, 
[src]

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.