use traits::Grid;
use traits::Engine;
use traits::Consumer;


pub struct Sequential<G: Grid, C: Consumer> {
    grid: G,
    consumer: C
}

impl<G: Grid, C: Consumer> Sequential<G, C> {

    pub fn new(grid: G, consumer: C) -> Self {
        Sequential {
            grid: grid,
            consumer: consumer
        }
    }
}


impl<G: Grid, C: Consumer> Engine for Sequential<G, C> {
    fn run_times(&mut self, times: i64) {
        for _ in 0..times {
            self.grid.step();
            self.consumer.consume(&self.grid);
        }
    }
}
use traits::Cell;
use traits::Consumer;
use traits::Grid;
use traits::Engine;


pub struct Sequential<C: Cell, G: Grid<Cell=C>, Con: Consumer<Cell=C>> {
    grid: G,
    consumer: Con
}

impl<C: Cell, G: Grid<Cell=C>, Con: Consumer<Cell=C>> Sequential<C, G, Con> {

    pub fn new(grid: G, consumer: Con) -> Self {
        Sequential {
            grid: grid,
            consumer: consumer
        }
    }
}


impl<C: Cell, G: Grid<Cell=C>, Con: Consumer<Cell=C>> Engine for Sequential<C, G, Con> {
    fn run_times(&mut self, times: i64) {
        for _ in 0..times {
            self.grid.step();
            self.consumer.consume(&self.grid);
        }
    }
}
Support for the new constraint.
Support for the new constraint.
