Struct hex2d::Position [] [src]

pub struct Position<I: Integer = i32> {
    pub coord: Coordinate<I>,
    pub dir: Direction,
}

Position on 2d hexagonal grid (Coordinate + Direction)

Fields

x coordinate

y coordinate

Methods

impl<I: Integer> Position<I>
[src]

[src]

Create a new Position

Trait Implementations

impl<I: Copy + Integer> Copy for Position<I>
[src]

impl<I: Clone + Integer> Clone for Position<I>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<I: Eq + Integer> Eq for Position<I>
[src]

impl<I: PartialEq + Integer> PartialEq for Position<I>
[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<I: Hash + Integer> Hash for Position<I>
[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<I: Debug + Integer> Debug for Position<I>
[src]

[src]

Formats the value using the given formatter.

impl<I: Ord + Integer> Ord for Position<I>
[src]

[src]

This method returns an Ordering between self and other. Read more

1.22.0
[src]

Compares and returns the maximum of two values. Read more

1.22.0
[src]

Compares and returns the minimum of two values. Read more

impl<I: PartialOrd + Integer> PartialOrd for Position<I>
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

[src]

This method tests less than (for self and other) and is used by the < operator. Read more

[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<I: Decodable + Integer> Decodable for Position<I>
[src]

[src]

Deserialize a value using a Decoder.

impl<I: Integer> ToDirection for Position<I>
[src]

[src]

Convert to Angle part of this data

impl<I: Integer> ToCoordinate<I> for Position<I>
[src]

[src]

Convert to Coordinate part of this data

impl<I: Integer> Add<Coordinate<I>> for Position<I>
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl<I: Integer> Sub<Coordinate<I>> for Position<I>
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl<I: Integer> Add<Angle> for Position<I>
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.