Struct conway::Universe [] [src]

pub struct Universe { /* fields omitted */ }

Represents a wrapping universe in Conway's game of life.

Methods

impl Universe
[src]

[src]

[src]

[src]

[src]

[src]

[src]

Instantiate a new blank universe with the given width and height, in cells. The universe is at generation 1.

[src]

Return width in cells.

[src]

Return height in cells.

[src]

Get the latest generation number (1-based).

[src]

Compute the next generation. Returns the new latest generation number.

[src]

Iterate over every non-dead cell in the universe for the current generation. region is the rectangular area used for restricting results. visibility is an optional player_id; if specified, causes cells not visible to the player to be passed as CellState::Fog to the callback.

Callback receives (x, y, cell_state).

[src]

Iterate over every non-dead cell in the universe for the current generation. visibility is an optional player_id, allowing filtering based on fog. Callback receives (x, y, cell_state).

[src]

Get a Region of the same size as the universe

Trait Implementations

impl Display for Universe
[src]

[src]

Formats the value using the given formatter. Read more