HaniiPuppy

exception problem

Mar 25th, 2014
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.22 KB | None | 0 0
  1.     public Collection<Player> movePlayersToGame(Player player) throws PlayerNotOnlineException, PlayerAlreadyInGameException, GameNotInProgressException
  2.     {
  3.         if(!this.isInGame())
  4.             throw new GameNotInProgressException();
  5.        
  6.         if(!player.isOnline())
  7.             throw new PlayerNotOnlineException(player, "Cannot move player to game because player is not online.");
  8.        
  9.         synchronized(busyPlayersInGame)
  10.         {
  11.             if(this.playersInGame.contains(player))
  12.                 throw new PlayerAlreadyInGameException(player, "Player is already in game.");
  13.            
  14.             this.playersInGame.add(player);
  15.         }
  16.        
  17.         synchronized(busyPlayersInLobby)
  18.         { this.playersInLobby.remove(player); }
  19.        
  20.         this.currentStage.tpPlayersToStartingPositions(player);
  21.         return new ArrayList<Player>(Arrays.asList(player));
  22.     }
  23.    
  24.     public Collection<Player> movePlayersToGame(Collection<? extends Player> players) throws GameNotInProgressException
  25.     {
  26.         if(!this.isInGame())
  27.             throw new GameNotInProgressException();
  28.        
  29.         Collection<Player> returnVals = new ArrayList<Player>();
  30.        
  31.         // wip
  32.     }
Advertisement
Add Comment
Please, Sign In to add comment