[][src]Struct all_is_cubes::blockgen::BlockGen

pub struct BlockGen<'a> {
    pub universe: &'a mut Universe,
    pub size: GridCoordinate,
}

Utilities for generating blocks that are compatible with each other.

Fields

universe: &'a mut Universe

The Universe in which block spaces live.

size: GridCoordinate

The side length of block spaces.

Implementations

impl<'a> BlockGen<'a>[src]

pub fn new(universe: &'a mut Universe, size: GridCoordinate) -> Self[src]

pub fn new_block_space(&self) -> Space[src]

Create a Space of a suitable size for a block.

pub fn new_recursive_block(
    &mut self,
    attributes: BlockAttributes
) -> (Block, UBorrowMut<Space>)
[src]

Create a Block referring to a Space and return the Space for modification.

pub fn block_from_function(
    &mut self,
    attributes: BlockAttributes,
    f: impl Fn(&BlockGen<'_>, GridPoint, f32) -> Block
) -> Block
[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for BlockGen<'a>

impl<'a> !Send for BlockGen<'a>

impl<'a> !Sync for BlockGen<'a>

impl<'a> Unpin for BlockGen<'a>

impl<'a> !UnwindSafe for BlockGen<'a>

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> Erased for T[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.

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