pub struct NtLifeGen {
    b0: bool,
    s8: bool,
    gen: usize,
    symmetry: Symmetry,
    impl_table: Vec<ImplFlags>,
}
Expand description

Non-totalistic Life-like Generations rules.

This includes any rule that can be converted to a non-totalistic Life-like Generations rule.

Fields§

§b0: bool

Whether the rule contains B0.

§s8: bool

Whether the rule contains S8.

§gen: usize

Number of states.

§symmetry: Symmetry

The symmetry of the rule.

§impl_table: Vec<ImplFlags>

An array of actions for all neighborhood descriptors.

Implementations§

source§

impl NtLifeGen

source

pub fn new(b: &[u8], s: &[u8], gen: usize) -> Self

Constructs a new rule from the b and s data and the number of states.

source

pub fn non_gen(self) -> NtLife

Converts to the corresponding non-Generations rule.

Trait Implementations§

source§

impl Clone for NtLifeGen

source§

fn clone(&self) -> NtLifeGen

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl FromStr for NtLifeGen

§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str(input: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl ParseNtLifeGen for NtLifeGen

A parser for the rule.

source§

fn from_bsg(b: Vec<u8>, s: Vec<u8>, gen: usize) -> Self

Construct the rule from b / s data and the number of states.
source§

fn parse_rule(input: &str) -> Result<Self, ParseRuleError>where Self: Sized,

The parser.
source§

impl Rule for NtLifeGen

NOTE: This implementation does work when the number of states is 2.

§

type Desc = NbhdDescGen

The type of neighborhood descriptor of the rule. Read more
§

type IsGen = True

Whether the rule is a Generations rule.
source§

fn has_b0(&self) -> bool

Whether the rule contains B0. Read more
source§

fn has_b0_s8(&self) -> bool

Whether the rule contains both B0 and S8. Read more
source§

fn gen(&self) -> usize

The number of states.
source§

fn symmetry(&self) -> Symmetry

The symmetry of the rule.
source§

fn new_desc(state: State, succ_state: State) -> Self::Desc

Generates a neighborhood descriptor which says that all neighboring cells have states state, and the successor has state succ_state.
source§

fn update_desc(cell: &LifeCell<Self>, state: State, new: bool)

Updates the neighborhood descriptors of all neighbors and the predecessor when the state of one cell is changed. Read more
source§

fn consistify<A: Algorithm<Self>>( world: &mut World<Self, A>, cell: CellRef<Self> ) -> Result<(), A::ConflReason>

Consistifies a cell. Read more
source§

impl Sealed for NtLifeGen

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

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

source§

fn vzip(self) -> V