@Override
    public void ballPlaced(int player, Point R) {
        gameOver = (dc.getAsses() != null && dc.getAsses().isPlayerWinning(player)) || board.freeFields()==0;
        EngineEvent evt = new EngineEvent(this);
        evt.player=player;
        if(gameOver){
            if(board.freeFields()>0){
              evt.state=EngineState.GAMEOVER;  
            } else {
                if(dc.getAsses().isPlayerWinning(player)){
                    evt.state=EngineState.GAMEOVER;
                } else {
                  evt.state=EngineState.DRAW;  
                }
            }         
        } else {
            evt.state = EngineState.CONTINUE;          
        }
        notifyListeners(evt);
        if (!gameOver && automaticPlayer > 0 && 1 + player % numberOfPlayers == automaticPlayer) {
            evt.setState(EngineState.WAIT);
            //Set the player number to automatic, as the engine starts work on its own move and has to notify the listeners of that fact
            evt.player=automaticPlayer;
            notifyListeners(evt);
            
            new Thread(){
                
                @Override
                public void run(){
                    Point p = dc.decideMove(automaticPlayer, autoFirstMove);
                    board.placeBall(automaticPlayer, p.x, p.y); 
                }
                
            }.start();
            if (autoFirstMove) {
                autoFirstMove = false;
            }
        }
    }