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

pub struct Room(_);

Implementations

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
) -> Result<String, 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<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]

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]

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) -> 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]

impl InstanceOf for Room[src]

impl JsSerialize for Room[src]

impl JsSerializeOwned for Room[src]

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

impl PartialEq<Room> for Room[src]

impl ReferenceType for Room[src]

impl<'_r> TryFrom<&'_r Reference> 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 TryFrom<Reference> for Room[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<Room> for Reference[src]

type Error = Void

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.

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.