[][src]Trait spacebattleship::ships::ProjectIterState

pub trait ProjectIterState<D: Dimensions + ?Sized> {
    type ShipShape: ShipShape<D> + ?Sized;
    fn start(shape: &Self::ShipShape, dim: &D, coord: D::Coordinate) -> Self;
fn next(
        &mut self,
        shape: &Self::ShipShape,
        dim: &D
    ) -> Option<ShapeProjection<D::Coordinate>>; }

State type for the ship projection iterator.

Associated Types

Loading content...

Required methods

fn start(shape: &Self::ShipShape, dim: &D, coord: D::Coordinate) -> Self

Construct an instance of this iter state given the arguments.

fn next(
    &mut self,
    shape: &Self::ShipShape,
    dim: &D
) -> Option<ShapeProjection<D::Coordinate>>

Get the next possible projection of the ship's shape.

Loading content...

Implementors

Loading content...