mod life;
mod ntlife;
use crate::{
cells::{CellRef, LifeCell, State},
config::Symmetry,
search::Algorithm,
world::World,
};
pub use life::{Life, LifeGen};
pub use ntlife::{NtLife, NtLifeGen};
#[cfg(doc)]
use crate::cells::ALIVE;
use typebool::Bool;
pub(crate) mod typebool {
pub trait Bool {
const VALUE: bool;
}
#[derive(Debug, Clone, Copy)]
pub struct True;
impl Bool for True {
const VALUE: bool = true;
}
#[derive(Debug, Clone, Copy)]
pub struct False;
impl Bool for False {
const VALUE: bool = false;
}
}
#[cfg_attr(not(github_io), doc = "Some of its items are hidden in the doc.")]
pub trait Rule: private::Sealed {
type Desc: Copy;
type IsGen: Bool;
fn has_b0(&self) -> bool;
fn has_b0_s8(&self) -> bool;
fn gen(&self) -> usize;
fn symmetry(&self) -> Symmetry;
#[cfg_attr(not(github_io), doc(hidden))]
fn new_desc(state: State, succ_state: State) -> Self::Desc;
#[cfg_attr(not(github_io), doc(hidden))]
fn update_desc(cell: &LifeCell<Self>, state: State, new: bool);
#[cfg_attr(not(github_io), doc(hidden))]
fn consistify<A: Algorithm<Self>>(
world: &mut World<Self, A>,
cell: CellRef<Self>,
) -> Result<(), A::ConflReason>;
}
mod private {
pub trait Sealed: Sized {}
}