[−][src]Struct screeps_api::RoomName
A structure representing a room name.
Fields
x_coord: i32
Inner x coordinate representation.
0 represents E0, positive numbers represent E(x)
-1 represents W0, negative numbers represent W((-x) - 1)
y_coord: i32
Inner y coordinate representation.
0 represents N0, positive numbers represent N(y)
-1 represents S0, negative numbers represent S((-y) - 1)
Methods
impl RoomName
[src]
pub fn new<T: ?Sized>(x: &T) -> Result<Self, RoomNameParseError> where
T: IntoRoomName,
[src]
T: IntoRoomName,
Creates a new room name from the given input.
This will parse the input, and return an error if it is in an invalid format.
pub fn from_pos(east: bool, north: bool, x_pos: i32, y_pos: i32) -> Self
[src]
Creates a new room name from the given position parameters.
Trait Implementations
impl IntoRoomName for RoomName
[src]
fn into_room_name(&self) -> Result<RoomName, RoomNameParseError>
[src]
impl PartialEq<RoomName> for RoomName
[src]
impl Clone for RoomName
[src]
fn clone(&self) -> RoomName
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl From<RoomName> for RoomNameAbsoluteCoordinates
[src]
fn from(other: RoomName) -> RoomNameAbsoluteCoordinates
[src]
impl From<RoomNameAbsoluteCoordinates> for RoomName
[src]
fn from(other: RoomNameAbsoluteCoordinates) -> RoomName
[src]
impl Copy for RoomName
[src]
impl Eq for RoomName
[src]
impl Hash for RoomName
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Add<(i32, i32)> for RoomName
[src]
type Output = RoomName
The resulting type after applying the +
operator.
fn add(self, (x, y): (i32, i32)) -> RoomName
[src]
Adds an (x, y) coordinate pair to this room name.
impl Sub<(i32, i32)> for RoomName
[src]
type Output = RoomName
The resulting type after applying the -
operator.
fn sub(self, (x, y): (i32, i32)) -> RoomName
[src]
Subtracts an (x, y) coordinate pair to this room name.
impl Sub<RoomName> for RoomName
[src]
type Output = (i32, i32)
The resulting type after applying the -
operator.
fn sub(self, other: RoomName) -> (i32, i32)
[src]
Subtracts an (x, y) coordinate pair to this room name.
impl Debug for RoomName
[src]
impl Display for RoomName
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats this room name into the format the game expects.
Resulting string will be (E|W)[0-9]+(N|S)[0-9]+
, and will result
in an equal same RoomName if passed into into_room_name
.
impl Serialize for RoomName
[src]
impl<'de> Deserialize<'de> for RoomName
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
Auto Trait Implementations
impl Sync for RoomName
impl Unpin for RoomName
impl Send for RoomName
impl UnwindSafe for RoomName
impl RefUnwindSafe for RoomName
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From<T> for 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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> Erased for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,