fixed Exception handling
This commit is contained in:
@@ -40,14 +40,21 @@ public class ByeGame extends Game{
|
||||
@Override
|
||||
public List<Game> getAllGames()
|
||||
{
|
||||
List<Game> temp = new ArrayList(Arrays.asList(this.getId()));
|
||||
List<Game> temp = new ArrayList<>();
|
||||
temp.add(this);
|
||||
temp.addAll(ref.getAllGames());
|
||||
return temp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getRemaningPlayers() {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'getRemaningPlayers'");
|
||||
if (winner != null) {
|
||||
return Arrays.asList(winner);
|
||||
} else {
|
||||
List<String> players = new ArrayList<>();
|
||||
players.add(player1);
|
||||
players.addAll(ref.getRemaningPlayers());
|
||||
return players;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user