public class ChessBoard {
    ChessFactory factory = new ChessFactory();

    private Chess ChessStatus[][] = new Chess[20][20];
    private short nowPlayer;
    private int step;
    private Rule rule;

    public ChessBoard(Rule rule) {
        initializeGame();
        // Clean Chess Board
        initializeChessBoard();
        this.rule = rule;
    }

    private void initializeGame() {
        // First step = 0
        this.step = 0;

        // Black Chess First
        this.nowPlayer = Const.BLACK_CHESS;
    }

    private void initializeChessBoard() {
        for (int i = 0; i < 20; i++) {
            for (int j = 0; j < 20; j++) {
                this.ChessStatus[i][j] = null;
            }
        }
    }

    public short clickDot(Location loc) {
        // Make Chess
        this.ChessStatus[loc.getX()][loc.getY()] = factory.makeChess(this.nowPlayer, loc, this.step);

        // Check Finish
        short winner = this.checkFinish();

        if (winner == Const.NO_WIN) {
            return Const.NO_WIN;
        } else if (winner == Const.TIE) {
            return Const.TIE;
        } else if (winner == Const.BLACK_WIN) {
            step++;
            return Const.BLACK_WIN;
        } else if (winner == Const.WHITE_WIN) {
            step++;
            return Const.WHITE_WIN;
        }
        return Const.NO_WIN;
    }

    private short checkFinish() {
        return this.rule.check(ChessStatus);
    }

    public void changePlayer() {
        if (this.nowPlayer == Const.BLACK_CHESS) {
            this.nowPlayer = Const.WHITE_CHESS;
        } else {
            this.nowPlayer = Const.BLACK_CHESS;
        }
    }

    public short getNowPlayer() {
        return nowPlayer;
    }
}
@@ -1009,346 +1009,80 @@
     
-return Const.NO_WIN;%0A        %7D else if (winner == Const.TIE) %7B%0A            return Const.TIE;%0A        %7D else if (winner == Const.BLACK_WIN) %7B%0A            step++;%0A            return Const.BLACK_WIN;%0A        %7D else if (winner == Const.WHITE_WIN) %7B%0A            step++;%0A            return Const.WHITE_WIN;%0A        %7D%0A        return Const.NO_WIN
+this.changePlayer();%0A            step++;%0A        %7D%0A        return winner
 ;%0A  
@@ -1451,10 +1451,181 @@
 r;%0A    %7D
+%0A%0A    public void Surrender() %7B%0A        // TODO: Show Winner (UI)%0A        System.out.println(%22Winner: %22 + (this.nowPlayer == Const.BLACK_CHESS ? %22BLACK%22 : %22WHITE%22));%0A    %7D
 %0A%7D

Add Surrender