示例#1
0
文件: Game.java 项目: FHNW-IWI/AIGS
 /**
  * Sends a message to all players in the current game.<br>
  * The message will not be sent to players with the {@link Player#isAi} flag.
  *
  * @param message The message to be sent.
  */
 public void sendMessageToAllPlayers(Message message) {
   for (Player p : players) {
     if (p.isAi() == false || p.getSocket() != null) {
       message.send(p.getSocket(), p);
     }
   }
 }
示例#2
0
文件: Game.java 项目: FHNW-IWI/AIGS
 /**
  * Sends a message to the current player. The message will not be sent to players with the {@link
  * Player#isAi} flag.
  *
  * @param message The message to be sent.
  */
 public void sendMessageToCurrentPlayer(Message message) {
   if (currentPlayer.isAi() == false) {
     message.send(currentPlayer.getSocket(), currentPlayer);
   }
 }
示例#3
0
文件: Game.java 项目: FHNW-IWI/AIGS
 /**
  * Sends a message to a single player. The message will not be sent to players with the {@link
  * Player#isAi} flag.
  *
  * @param message The message to be sent.
  * @param player The player who will receive the message.
  */
 public void sendMessageToPlayer(Message message, Player player) {
   if (player.isAi() == false) {
     message.send(player.getSocket(), player);
   }
 }