@Override
    public void onClick(MouseEvent e, int x, int y) {
        if(boardTool == BoardTool.MAKE_MOVE) {
            if(currentPlayerTurn == player) {
                int stat = board.makeMove(player, x, y);

                if(stat >= 0) {
                    SoundManager.playStoneSound();
                    
                    boardScore.addCapture(player, stat);
                    
                    this.switchTurns();

                    if(host != null) {
                        host.send("MAKEMOVE&"+x+"&"+y+"\n");
                    }
                    else if(client != null) {
                        client.send("MAKEMOVE&"+x+"&"+y+"\n");
                    }
                }
            }
        }
        else if(boardTool == BoardTool.REMOVE_STONE) {
            int wcaps = board.clearGroup(BoardPiece.BLACK_STONE, x, y);
            int bcaps = board.clearGroup(BoardPiece.WHITE_STONE, x, y);
            
            boardScore.addCapture(BoardPiece.BLACK_STONE, bcaps);
            boardScore.addCapture(BoardPiece.WHITE_STONE, wcaps);
            
            if(host != null) {
                host.send("REMOVE&"+x+"&"+y+"\n");
            }
            else if(client != null) {
                client.send("REMOVE&"+x+"&"+y+"\n");
            }
            
            this.onCountButtonClick();
        }
    }