pub struct GridRectangle { /* private fields */ }Expand description
represents a rectangle of regions defined by the lower left (minimum coordinates)
and upper right (maximum coordinates) corners in GridCoordinates
Implementations§
Source§impl GridRectangle
impl GridRectangle
Sourcepub fn new(corner1: GridCoordinates, corner2: GridCoordinates) -> Self
pub fn new(corner1: GridCoordinates, corner2: GridCoordinates) -> Self
creates a new GridRectangle given any two corners
Trait Implementations§
Source§impl Clone for GridRectangle
impl Clone for GridRectangle
Source§fn clone(&self) -> GridRectangle
fn clone(&self) -> GridRectangle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GridRectangle
impl Debug for GridRectangle
Source§impl GridRectangleLike for GridRectangle
impl GridRectangleLike for GridRectangle
Source§fn grid_rectangle(&self) -> GridRectangle
fn grid_rectangle(&self) -> GridRectangle
the
GridRectangle represented by this map like imageSource§fn lower_left_corner(&self) -> GridCoordinates
fn lower_left_corner(&self) -> GridCoordinates
returns the lower left corner of the rectangle
Source§fn upper_right_corner(&self) -> GridCoordinates
fn upper_right_corner(&self) -> GridCoordinates
returns the upper right corner of the rectangle
Source§fn x_range(&self) -> RangeInclusive<u16>
fn x_range(&self) -> RangeInclusive<u16>
returns a range for the region x coordinates of this rectangle
Source§fn y_range(&self) -> RangeInclusive<u16>
fn y_range(&self) -> RangeInclusive<u16>
returns a range for the region y coordinates of this rectangle
Source§fn lower_right_corner(&self) -> GridCoordinates
fn lower_right_corner(&self) -> GridCoordinates
returns the lower right corner of the rectangle
Source§fn upper_left_corner(&self) -> GridCoordinates
fn upper_left_corner(&self) -> GridCoordinates
returns the upper left corner of the rectangle
Source§fn contains(&self, grid_coordinates: &GridCoordinates) -> bool
fn contains(&self, grid_coordinates: &GridCoordinates) -> bool
checks if a given set of
GridCoordinates is within this GridRectangleSource§fn intersect<O>(&self, other: &O) -> Option<GridRectangle>where
O: GridRectangleLike,
fn intersect<O>(&self, other: &O) -> Option<GridRectangle>where
O: GridRectangleLike,
returns a new
GridRectangle which is the area where this GridRectangle
and another intersect each other or None if there is no intersectionSource§fn pps_hud_config(&self) -> String
fn pps_hud_config(&self) -> String
returns a PPS HUD description string for this
GridRectangle Read moreSource§impl PartialEq for GridRectangle
impl PartialEq for GridRectangle
impl Eq for GridRectangle
impl StructuralPartialEq for GridRectangle
Auto Trait Implementations§
impl Freeze for GridRectangle
impl RefUnwindSafe for GridRectangle
impl Send for GridRectangle
impl Sync for GridRectangle
impl Unpin for GridRectangle
impl UnwindSafe for GridRectangle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more