[]Struct rltk::XpLayer

pub struct XpLayer {
    pub width: usize,
    pub height: usize,
    pub cells: Vec<XpCell>,
}

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

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,