Class KnockOut
java.lang.Object
edu.ntnu.idatt1002.k01g08.fta.objects.tournaments.Tournament
edu.ntnu.idatt1002.k01g08.fta.objects.tournaments.KnockOut
Creates a KnockOut type of Tournament
-
Field Summary
Fields inherited from class edu.ntnu.idatt1002.k01g08.fta.objects.tournaments.Tournament
previousRoundMatches
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Finds what matches are going to be played, then places them in the upcomingMatches-list.boolean
numberOfTeamsInvalid
(int num) Checks if the variable is in the power of 2, It has to be that inorder to be a valid knockout-tournament.Methods inherited from class edu.ntnu.idatt1002.k01g08.fta.objects.tournaments.Tournament
addAllTeams, addTeam, endMatch, equals, getCurrentMatch, getFirstPrize, getMatches, getMatchLength, getNumberOfTeams, getStartDate, getTeams, getTournamentName, getUpcomingMatches, getWinner, setUpcomingMatch, setWinner, startNextMatch, toString
-
Constructor Details
-
KnockOut
-
KnockOut
Constructor for a KnockOut-Tournament- Parameters:
name
- the name of the tournamentteams
- a list of all teams in the tournament- Throws:
IllegalArgumentException
-
KnockOut
public KnockOut(String name, String startDate, ArrayList<Team> teams, int matchLength) throws IllegalArgumentException Constructor for a KnockOut-Tournament- Parameters:
name
- the name of the tournamentstartDate
- when the tournament startsteams
- a list of all teams in the tournamentmatchLength
- the length which the match should be- Throws:
IllegalArgumentException
-
KnockOut
public KnockOut(String name, String startDate, int firstPrice, ArrayList<Team> teams) throws IllegalArgumentException Constructor for a KnockOut-Tournament- Parameters:
name
- the name of the tournamentstartDate
- when the tournament startsteams
- a list of all teams in the tournamentfirstPrice
- what you get for achieving first place- Throws:
IllegalArgumentException
-
KnockOut
public KnockOut(ArrayList<Team> teams, String tournamentName, int firstPrize, String startDate, int matchLength) throws IllegalArgumentException Constructor for a KnockOut-Tournament- Parameters:
teams
- a list of all teams in the tournamenttournamentName
- the name of the tournamentfirstPrize
- what you get for achieving first placestartDate
- when the tournament startsmatchLength
- the length which the match should be- Throws:
IllegalArgumentException
-
KnockOut
-
-
Method Details
-
numberOfTeamsInvalid
public boolean numberOfTeamsInvalid(int num) Checks if the variable is in the power of 2, It has to be that inorder to be a valid knockout-tournament.- Returns:
- true if it's valid, false if it's not
-
findUpcomingMatches
public void findUpcomingMatches()Finds what matches are going to be played, then places them in the upcomingMatches-list.- Specified by:
findUpcomingMatches
in classTournament
-