예제 #1
0
 public void receiveCommandList(CommandList ls) {
   turnCommands.addCommands(ls.getCommands());
   commandsReceived++;
   System.out.println(commandsReceived + " " + myInfo.getPlayers().size());
   if (commandsReceived >= myInfo.getPlayers().size()) {
     this.processCommands();
     if (!unitsPlaced) {
       unitsPlaced = true;
       this.start();
     }
   }
 }
예제 #2
0
 public void addPlayer(ServerPlayer p) {
   if (myInfo.addPlayer(p) && !inProgress) {
     myGame = new GameState(myInfo.getPlayers());
     myModel = new GameModel(myGame, this);
     this.updateGame(myGame);
     this.updateGame(new PromptUnits());
     inProgress = true;
   } else if (inProgress) {
     this.updateGame();
   }
 }
예제 #3
0
 public ServerGame(GameInfo info, GameState game, ObjectServer os) {
   myInfo = info;
   myInfo.getPlayers().clear();
   myGame = game;
   myServer = os;
   myModel = new GameModel(myGame, this);
   if (!myInfo.getOriginalPlayers().isEmpty()) {
     unitsPlaced = true;
     inProgress = true;
     this.start();
   }
 }