[−][src]Struct wasmdome_domain::Point
A 2-dimensional coordinate within an arena
Fields
x: i32
y: i32
Implementations
impl Point
[src]
pub fn new(x: i32, y: i32) -> Point
[src]
pub fn bearing(&self, target: &Point) -> GridDirection
[src]
pub fn adjacent_points(&self, board: &GameBoard) -> Vec<Point>
[src]
pub fn gather_points(
&self,
board: &GameBoard,
direction: &GridDirection,
count: usize
) -> Vec<(Point, usize)>
[src]
&self,
board: &GameBoard,
direction: &GridDirection,
count: usize
) -> Vec<(Point, usize)>
pub fn relative_point(
&self,
board: &GameBoard,
direction: &GridDirection,
length: i32
) -> Option<Point>
[src]
&self,
board: &GameBoard,
direction: &GridDirection,
length: i32
) -> Option<Point>
Returns a point 1 unit away in the direction indicated. Grid origin is the most Southwest point
pub fn is_on_board(&self, board: &GameBoard) -> bool
[src]
Trait Implementations
impl Clone for Point
[src]
impl Debug for Point
[src]
impl<'de> Deserialize<'de> for Point
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl PartialEq<Point> for Point
[src]
impl Serialize for Point
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for Point
[src]
Auto Trait Implementations
impl RefUnwindSafe for Point
impl Send for Point
impl Sync for Point
impl Unpin for Point
impl UnwindSafe for Point
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
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, 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>,