Interface BoardGameSubject

All Known Implementing Classes:
BoardGame, LadderBoardGame, LudoBoardGame

public interface BoardGameSubject
BoardGameSubject interface

This interface defines the methods for a board game subject in the observer pattern.

  • Method Details

    • addObserver

      void addObserver(BoardGameObserver observer)
      Adds an observer to the subject.
      Parameters:
      observer - the observer to add
    • removeObserver

      void removeObserver(BoardGameObserver observer)
      Removes an observer from the subject.
      Parameters:
      observer - the observer to remove
    • notifyRoundNumberIncremented

      void notifyRoundNumberIncremented(int roundNumber)
      Notifies the observers that the round number has incremented.
      Parameters:
      roundNumber - the new round number
    • notifyCurrentPlayerChanged

      void notifyCurrentPlayerChanged(Player player)
      Notifies the observers that the current player has changed.
      Parameters:
      player - the new current player
    • notifyGameFinished

      void notifyGameFinished(Player winner)
      Notifies the observers that the game has finished.
      Parameters:
      winner - the winner of the game