Class RoundCollectionFactory

java.lang.Object
edu.ntnu.idatt1002.k2g05.factories.RoundCollectionFactory

public final class RoundCollectionFactory extends Object
Factory for making round collections easier to use.
  • Method Details

    • getAndFillQualificationRoundCollection

      public static RoundCollection getAndFillQualificationRoundCollection(String name, List<Player> players)
      Method for getting and filling a qualification round collection given a nam eof the round collection and the players that is going to play in the qualificatio
      Parameters:
      name - of the collection
      players - to participate.
      Returns:
      the RoundCollection created.
    • getEmptyGroupStageCollection

      public static RoundCollection getEmptyGroupStageCollection(String name, int groups)
    • getEmptyQuarterFinalCollection

      public static RoundCollection getEmptyQuarterFinalCollection(String name)
      Method for creating an empty quarter final collection given the nam
      Parameters:
      name - of the collection
      Returns:
      the empty collection
    • getEmptySemiFinalCollection

      public static RoundCollection getEmptySemiFinalCollection(String name)
      Method for getting an empty semi-final
      Parameters:
      name - of the round collection
      Returns:
      the empty collection
    • getEmptyFinalCollection

      public static RoundCollection getEmptyFinalCollection(String name)
      Method for creating an empty final collection
      Parameters:
      name - of the collection
      Returns:
      the empty collection
    • updateGroupStageCollectionWithSnakeFill

      public static void updateGroupStageCollectionWithSnakeFill(RoundCollection collection, List<Player> players, int playersPerRound)
      Method for filling in a group stage collection with snake fill given the players that are going to be filled in the collection Snake fill looks like with 16 players with 4 per round this: (where number is position after qualification) |A |B |C |D | |1 |2 |3 |4 | |8 |7 |6 |5 | |9 |10|11|12| |16|15|14|13|
      Parameters:
      collection - to be filled
      players - to put in collecition
      playersPerRound - amount of players per round.
    • getEmptyQualificationCollection

      public static RoundCollection getEmptyQualificationCollection(String name)
      Method for getting an empty qualification collection
      Parameters:
      name - of collecion
      Returns:
      empty collection
    • fillQualificationCollection

      public static void fillQualificationCollection(RoundCollection collection, List<Player> players)
      Method for filling a given qualification collection with players
      Parameters:
      collection -
      players -
    • fillFinalFromGroupPlay

      public static void fillFinalFromGroupPlay(RoundCollection finalCollection, RoundCollection groupPlayCollection)
      Method for filling a final collection from a group play collection. The amount of group must match the degree of final, E.g with 4 groups, it must go into a quarter final, with 8 groups it must go to an 8th-final.
      Parameters:
      finalCollection - to be filled
      groupPlayCollection - to fill from
    • fillFinalFromPreviousFinal

      public static void fillFinalFromPreviousFinal(RoundCollection finalCollection, RoundCollection previousFinalCollection)
      Method for filling the next final given the previous final, e.g. filling a semi-final by th winners of the quarter-final
      Parameters:
      finalCollection - to be filled.
      previousFinalCollection - to fill from.