/** Notifies the listener for the changes occured in the game */ private void notifyChanges() { if (gameEventsListener != null) { int p1 = gameLogic.getCounterForPlayer(GameLogic.PLAYER_ONE); int p2 = gameLogic.getCounterForPlayer(GameLogic.PLAYER_TWO); gameEventsListener.onScoreChanged(p1, p2); if (gameLogic.isFinished()) { int winner = GameLogic.EMPTY; if (p1 > p2) { winner = GameLogic.PLAYER_ONE; } else if (p2 > p1) { winner = GameLogic.PLAYER_TWO; } gameEventsListener.onGameFinished(winner); } } }