package li.seiji.minichess;

import li.seiji.minichess.move.Move;
import li.seiji.minichess.player.IPlayer;

public class Game {

    private Board board = new Board();
    private IPlayer white;
    private IPlayer black;

    public Game(IPlayer white, IPlayer black) {
        board.initialize();
        this.white = white;
        this.black = black;
    }

    public void run() throws InvalidMoveException {
        white.start();
        black.start();

        while(board.state.turn != Player.NONE) {
            IPlayer turnPlayer;
            IPlayer otherPlayer;
            if(board.state.turn == Player.WHITE) {
                turnPlayer = white; otherPlayer = black;
            } else {
                turnPlayer = black; otherPlayer = white;
            }

            Move move = turnPlayer.getMove(board);
            board.move(move);
            otherPlayer.setMove(board, move);

            board.prettyPrint();
        }
    }

}

@@ -485,27 +485,38 @@
 ate.
-turn != Player.NONE
+gameState == GameState.ONGOING
 ) %7B%0A
@@ -951,16 +951,103 @@
        %7D
+%0A%0A        System.out.println(%22And the winner is: %22 + board.state.gameState.toString());
 %0A    %7D%0A%0A

Implement proper Victory checking in Game