Class RoundCollectionFactory
java.lang.Object
edu.ntnu.idatt1002.k2g05.factories.RoundCollectionFactory
Factory for making round collections easier to use.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
fillFinalFromGroupPlay
(RoundCollection finalCollection, RoundCollection groupPlayCollection) Method for filling a final collection from a group play collection.static void
fillFinalFromPreviousFinal
(RoundCollection finalCollection, RoundCollection previousFinalCollection) Method for filling the next final given the previous final, e.g.static void
fillQualificationCollection
(RoundCollection collection, List<Player> players) Method for filling a given qualification collection with playersstatic 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 qualificatiostatic RoundCollection
Method for creating an empty final collectionstatic RoundCollection
getEmptyGroupStageCollection
(String name, int groups) static RoundCollection
Method for getting an empty qualification collectionstatic RoundCollection
Method for creating an empty quarter final collection given the namstatic RoundCollection
Method for getting an empty semi-finalstatic 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|
-
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 collectionplayers
- to participate.- Returns:
- the RoundCollection created.
-
getEmptyGroupStageCollection
-
getEmptyQuarterFinalCollection
Method for creating an empty quarter final collection given the nam- Parameters:
name
- of the collection- Returns:
- the empty collection
-
getEmptySemiFinalCollection
Method for getting an empty semi-final- Parameters:
name
- of the round collection- Returns:
- the empty collection
-
getEmptyFinalCollection
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 filledplayers
- to put in collecitionplayersPerRound
- amount of players per round.
-
getEmptyQualificationCollection
Method for getting an empty qualification collection- Parameters:
name
- of collecion- Returns:
- empty collection
-
fillQualificationCollection
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 filledgroupPlayCollection
- 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.
-