java.lang.Object
edu.ntnu.idatt1002.k01g08.fta.objects.tournaments.Tournament
edu.ntnu.idatt1002.k01g08.fta.objects.tournaments.KnockOut

public class KnockOut extends Tournament
Creates a KnockOut type of Tournament
  • Constructor Details

    • KnockOut

      public KnockOut(String tournamentName, int stages)
    • KnockOut

      public KnockOut(String name, ArrayList<Team> teams) throws IllegalArgumentException
      Constructor for a KnockOut-Tournament
      Parameters:
      name - the name of the tournament
      teams - 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 tournament
      startDate - when the tournament starts
      teams - a list of all teams in the tournament
      matchLength - 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 tournament
      startDate - when the tournament starts
      teams - a list of all teams in the tournament
      firstPrice - 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 tournament
      tournamentName - the name of the tournament
      firstPrize - what you get for achieving first place
      startDate - when the tournament starts
      matchLength - the length which the match should be
      Throws:
      IllegalArgumentException
    • KnockOut

      public KnockOut(String tournamentName)
  • 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 class Tournament