Struct screeps::LocalRoomName [] [src]

pub struct LocalRoomName {
    pub x_coord: i32,
    pub y_coord: i32,
}

A structure representing a room name.

Fields

Inner x coordinate representation.

0 represents E0, positive numbers represent E(x)

-1 represents W0, negative numbers represent W((-x) - 1)

Inner y coordinate representation.

0 represents N0, positive numbers represent N(y)

-1 represents S0, negative numbers represent S((-y) - 1)

Methods

impl LocalRoomName
[src]

[src]

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.

[src]

Creates a new room name from the given position parameters.

Trait Implementations

impl Serialize for LocalRoomName
[src]

[src]

Serialize this value into the given Serde serializer. Read more

impl<'de> Deserialize<'de> for LocalRoomName
[src]

[src]

Deserialize this value from the given Serde deserializer. Read more

impl TryFrom<Value> for LocalRoomName

The type returned in the event of a conversion error.

Performs the conversion.

impl JsSerializeOwned for LocalRoomName

impl<'_r> JsSerializeOwned for &'_r LocalRoomName

impl JsSerialize for LocalRoomName

impl TryFrom<LocalRoomName> for Value

The type returned in the event of a conversion error.

Performs the conversion.

impl<'_a> TryFrom<&'_a LocalRoomName> for Value

The type returned in the event of a conversion error.

Performs the conversion.

impl<'_a> TryFrom<&'_a mut LocalRoomName> for Value

The type returned in the event of a conversion error.

Performs the conversion.

impl Copy for LocalRoomName
[src]

impl Clone for LocalRoomName
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for LocalRoomName
[src]

impl PartialEq for LocalRoomName
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Hash for LocalRoomName
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Debug for LocalRoomName
[src]

[src]

Formats the value using the given formatter. Read more

impl Display for LocalRoomName
[src]

[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 the same LocalRoomName if passed into LocalRoomName::new.

impl Add<(i32, i32)> for LocalRoomName
[src]

The resulting type after applying the + operator.

[src]

Adds an (x, y) coordinate pair to this room name.

impl Sub<(i32, i32)> for LocalRoomName
[src]

The resulting type after applying the - operator.

[src]

Subtracts an (x, y) coordinate pair to this room name.

impl Sub<LocalRoomName> for LocalRoomName
[src]

The resulting type after applying the - operator.

[src]

Subtracts an (x, y) coordinate pair to this room name.

Auto Trait Implementations

impl Send for LocalRoomName

impl Sync for LocalRoomName