Struct rlifesrc_lib::rules::life::LifeGen
source · pub struct LifeGen {
b0: bool,
s8: bool,
gen: usize,
impl_table: [ImplFlags; 4096],
}
Expand description
Totalistic Life-like Generations rules.
Fields§
§b0: bool
Whether the rule contains B0
.
s8: bool
Whether the rule contains S8
.
gen: usize
Number of states.
impl_table: [ImplFlags; 4096]
An array of actions for all neighborhood descriptors.
Implementations§
Trait Implementations§
source§impl ParseLifeGen for LifeGen
impl ParseLifeGen for LifeGen
A parser for the rule.
source§impl Rule for LifeGen
impl Rule for LifeGen
NOTE: This implementation does work when the number of states is 2.
§type Desc = NbhdDescGen
type Desc = NbhdDescGen
The type of neighborhood descriptor of the rule. Read more
source§fn new_desc(state: State, succ_state: State) -> Self::Desc
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)
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>
fn consistify<A: Algorithm<Self>>( world: &mut World<Self, A>, cell: CellRef<Self> ) -> Result<(), A::ConflReason>
Consistifies a cell. Read more
impl Sealed for LifeGen
Auto Trait Implementations§
impl RefUnwindSafe for LifeGen
impl Send for LifeGen
impl Sync for LifeGen
impl Unpin for LifeGen
impl UnwindSafe for LifeGen
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