pub struct TileNet<T> { /* private fields */ }
Expand description
TileNet
is the main class in this library
It represents a 2D space with dimensions rows x columns. Each index represents a point in space. Row ‘n’ and column ‘m’ denote the tile from x from n inclusive to n+1 exclusive, and y from m inclusive to m+1 exclusive.
use tile_net::TileNet;
#[derive(Clone, Debug, Default)]
struct Example(i32);
let my_net = TileNet::<Example>::new(10, 10);
println!("{:?}", my_net);
Implementations§
source§impl<T> TileNet<T>where
T: Clone,
impl<T> TileNet<T>where T: Clone,
source§impl<T> TileNet<T>
impl<T> TileNet<T>
sourcepub fn view_center_f32(
&self,
position: (f32, f32),
span: (usize, usize)
) -> TileView<'_, T> ⓘ
pub fn view_center_f32( &self, position: (f32, f32), span: (usize, usize) ) -> TileView<'_, T> ⓘ
Create a proxy view with a span from the center using a float position
sourcepub fn view_center(
&self,
position: (usize, usize),
span: (usize, usize)
) -> TileView<'_, T> ⓘ
pub fn view_center( &self, position: (usize, usize), span: (usize, usize) ) -> TileView<'_, T> ⓘ
Create a proxy view with a span from the center using an integer position
sourcepub fn view_box(
&self,
rectangle: (usize, usize, usize, usize)
) -> TileView<'_, T> ⓘ
pub fn view_box( &self, rectangle: (usize, usize, usize, usize) ) -> TileView<'_, T> ⓘ
Create a view box that iterates over tiles within that box
Trait Implementations§
Auto Trait Implementations§
impl<T> RefUnwindSafe for TileNet<T>where T: RefUnwindSafe,
impl<T> Send for TileNet<T>where T: Send,
impl<T> Sync for TileNet<T>where T: Sync,
impl<T> Unpin for TileNet<T>where T: Unpin,
impl<T> UnwindSafe for TileNet<T>where T: UnwindSafe,
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