uebung04
This commit is contained in:
53
uebung04/tournament/ByeGame.java
Normal file
53
uebung04/tournament/ByeGame.java
Normal file
@@ -0,0 +1,53 @@
|
||||
package tournament;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class ByeGame extends Game{
|
||||
private final String player1;
|
||||
private final Game ref;
|
||||
|
||||
ByeGame(String player1, Game ref){
|
||||
super();
|
||||
this.ref = ref;
|
||||
this.player1 = player1;
|
||||
}
|
||||
|
||||
public Game getRef() {
|
||||
return ref;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPlayer1() {
|
||||
return player1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPlayer2() {
|
||||
return ref.getWinner();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getAllPlayers() {
|
||||
List<String> players = new ArrayList<String>();
|
||||
players.add(player1);
|
||||
players.addAll(ref.getAllPlayers());
|
||||
return players;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Game> getAllGames()
|
||||
{
|
||||
List<Game> temp = new ArrayList(Arrays.asList(this.getId()));
|
||||
temp.addAll(ref.getAllGames());
|
||||
return temp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getRemaningPlayers() {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'getRemaningPlayers'");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user