[−][src]Struct conway::universe::Region
Rectangular area within a Universe
.
Methods
impl Region
[src]
A region is a rectangular area within a Universe
. All coordinates are game coordinates.
pub fn new(left: isize, top: isize, width: usize, height: usize) -> Self
[src]
Creates a new region given x and y coordinates of top-left corner, and width and height, all in units of cells (game coordinates). Width and height must both be positive.
pub fn left(&self) -> isize
[src]
Returns the x coordinate of the leftmost cells of the Region, in game coordinates.
pub fn right(&self) -> isize
[src]
Returns the x coordinate of the rightmost cells of the Region, in game coordinates.
pub fn top(&self) -> isize
[src]
Returns the y coordinate of the uppermost cells of the Region, in game coordinates.
pub fn bottom(&self) -> isize
[src]
Returns the y coordinate of the lowermost cells of the Region, in game coordinates.
pub fn width(&self) -> usize
[src]
Returns the width of the Region (along x axis), in game coordinates.
pub fn height(&self) -> usize
[src]
Returns the height of the Region (along y axis), in game coordinates.
pub fn contains(&self, col: isize, row: isize) -> bool
[src]
Determines whether the specified cell is part of the Region.
pub fn intersection(&self, other: Region) -> Option<Region>
[src]
Trait Implementations
impl PartialOrd<Region> for Region
[src]
fn partial_cmp(&self, other: &Region) -> Option<Ordering>
[src]
fn lt(&self, other: &Region) -> bool
[src]
fn le(&self, other: &Region) -> bool
[src]
fn gt(&self, other: &Region) -> bool
[src]
fn ge(&self, other: &Region) -> bool
[src]
impl Copy for Region
[src]
impl PartialEq<Region> for Region
[src]
impl Clone for Region
[src]
fn clone(&self) -> Region
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Ord for Region
[src]
fn cmp(&self, other: &Region) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl Eq for Region
[src]
impl Debug for Region
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto 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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,