import java.awt.*;
import java.awt.event.*;

public class MyController implements PlayConstants,
                                     Controller {
    private Model  game;
    private View   view;
    public void setup(Model m, View v) { 
        game = m; view = v;
    }
    public void checkMove(int place) {
        if (game.movePossible(place)) {
            game.makePlayerMove(place);
        }
        else view.illegalMove(place);
    }
    public void switchPlayer() {
        if (game.finished()) return;
        game.makeBestMove();
    }
    public void restart() {
        view.init();
        game = new Game(view);
}   }

      

   
