[][src]Struct lysogeny_broth::Universe

pub struct Universe {
    pub grid: Grid,
    // some fields omitted
}

A universe contains everything you need to enable Cellular Automata to do their thing.

Fields

grid: Grid

Implementations

impl Universe[src]

pub fn new(
    h_size: u8,
    v_size: u8,
    rules: fn(_: u8, _: u8, _: &Grid) -> CellState
) -> Universe
[src]

Create a new universe with only dead cells.

Arguments

  • h_size: horizontal dimension/size as number of cells
  • v_size: vertical dimension/size as number of cells
  • rules: a function mapping a coordinate (and thus the state of a cell) on a grid to a new state

pub fn update(&mut self)[src]

Update the universe according to the given state and rules

Trait Implementations

impl Clone for Universe[src]

impl Copy for Universe[src]

Auto Trait Implementations

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, 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.