Example #1
0
 /**
  * called to set output message
  *
  * @param message message
  */
 public void setMessage(String message) {
   this.message = message;
   setChanged();
   notifyObservers(message);
   if (GlobalConfig.isServerMode()) {
     clientsCommunicator.displayMessage(message);
   }
 }
Example #2
0
 /**
  * called to display whole field
  *
  * @param field connect4 field
  */
 public void setField(char[][] field) {
   this.field = field;
   setChanged();
   notifyObservers(field);
   if (GlobalConfig.isServerMode()) {
     clientsCommunicator.displayField(field);
   }
 }
Example #3
0
 /**
  * called to request players move
  *
  * @param playerInterface player
  */
 public void setPlayerMoveRequestMessage(PlayerInterface playerInterface) {
   this.playerInterface = playerInterface;
   if (GlobalConfig.isServerMode()) {
     clientsCommunicator.displayUserMoveRequested(
         (Player) playerInterface, playerInterface.getName() + "'s move: ");
   }
   setChanged();
   notifyObservers(playerInterface);
 }