[−]Struct rltk::XpLayer
Structure representing a layer Cells are in the same order as in the file, in column-major order (index of position x,y is y*height + x).
Fields
width: usize
Width of layer (in cells)
height: usize
Height of layer (in cells)
cells: Vec<XpCell>
Content of layer
Methods
impl XpLayer
pub fn new(width: usize, height: usize) -> XpLayer
Construct a new XpLayer of width by height. The contents will be empty (black foreground and background, character 0).
pub fn get(&self, x: usize, y: usize) -> Option<&XpCell>
Get the cell at coordinates (x,y), or None if it is out of range.
pub fn get_mut(&mut self, x: usize, y: usize) -> Option<&mut XpCell>
Get mutable reference to the cell at coordinates (x,y), or None if it is out of range.
Trait Implementations
impl Clone for XpLayer
fn clone(&self) -> XpLayer
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for XpLayer
impl PartialEq<XpLayer> for XpLayer
impl StructuralPartialEq for XpLayer
Auto Trait Implementations
impl RefUnwindSafe for XpLayer
impl Send for XpLayer
impl Sync for XpLayer
impl Unpin for XpLayer
impl UnwindSafe for XpLayer
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> 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>,
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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,