@Override
    public void onResponse(String response) {
        String data[] = response.split("&");
        
        if(data[0].equals("MAKEMOVE")) {
            startCounting = false;
            
            int x = Integer.parseInt(data[1]);
            int y = Integer.parseInt(data[2]);
            
            if(player == BoardPiece.BLACK_STONE)
                board.makeMove(BoardPiece.WHITE_STONE, x, y);
            else {
                board.makeMove(BoardPiece.BLACK_STONE, x, y);
            }
            
            this.switchTurns();
            
            board.repaint();
        }
        else if(data[0].equals("PASS")) {
            this.switchTurns();
            
            if(startCounting) {
                this.onCountButtonClick();
                
                if(host != null) {
                    host.send("SHOWTERRITORY\n");
                }
                else if(client != null) {
                    client.send("SHOWTERRITORY\n");
                }
            }
        }
        else if(data[0].equals("REMOVE")) {
            int x = Integer.parseInt(data[1]);
            int y = Integer.parseInt(data[2]);
            
            boardScore.addCapture(BoardPiece.BLACK_STONE, board.clearGroup(BoardPiece.WHITE_STONE, x, y));
            boardScore.addCapture(BoardPiece.WHITE_STONE, board.clearGroup(BoardPiece.BLACK_STONE, x, y));
            
            this.onCountButtonClick();
        }
        else if(data[0].equals("SHOWTERRITORY")) {
            this.onCountButtonClick();
        }
    }