package org.academiadecodigo.enuminatti.paint;

import org.academiadecodigo.enuminatti.paint.grid.Grid;
import org.academiadecodigo.enuminatti.paint.painter.Painter;
import org.academiadecodigo.enuminatti.paint.painter.PainterFactory;
import org.academiadecodigo.enuminatti.paint.painter.PainterType;

/**
 * MIT License
 * (c) 2017 Ricardo Constantino
 */

class Paint {
    private Grid grid;
    private Painter painter;

    void init(int cols, int rows, PainterType type) {

        grid = new Grid(cols, rows);
        painter = PainterFactory.createPainter(type, grid);

    }

    void start() throws InterruptedException {

        while (!grid.pressedQuit()) {
            painter.paint();
        }

        System.exit(0);

    }
}
