package tp.pr5.control;

import java.util.Scanner;

import tp.pr5.Resources.Resources;
import tp.pr5.command.Command;
import tp.pr5.command.CommandSet;
import tp.pr5.logic.Game;
import tp.pr5.logic.InvalidMove;
import tp.pr5.logic.Move;

public class ConsoleController extends Controller{
	private Scanner in;
	private boolean exit = false;
	
	public ConsoleController(GameTypeFactory factory, Game g, java.util.Scanner in) {
		super(factory,g, in);
		this.in= in;
	}
	
	public void run(){
		while ( !exit ) {
			System.out.print("> ");
			String line = in.nextLine();
			Command cmd = CommandSet.parse(line);
			if ( cmd != null){
				cmd.execute(this.getGame(),this,in);
				getGame().getBoard().printBoard();
			}
				else 
					System.err.print("Error: "+line);
		}
		in.close();
	}
	
	public void requestQuit(boolean exitAsk) {
		exit  = true;
		if (exitAsk)
			System.out.println("Exit requested. ");
	}

}

@@ -49,43 +49,8 @@
 r;%0A%0A
-import tp.pr5.Resources.Resources;%0A
 impo
@@ -139,67 +139,8 @@
 ame;
-%0Aimport tp.pr5.logic.InvalidMove;%0Aimport tp.pr5.logic.Move;
 %0A%0Apu

Update ConsoleController.java