Class MatchColumn
java.lang.Object
edu.ntnu.idatt1002.k2g05.controllers.opentournament.utils.MatchColumn
A Match Column is related to matches between to Players. The reason for this i because of duplicates and handling
them accordingly
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPlayerPairAndMatch
(PlayerPair playerPair, Match match) Method for adding a Player Pair and a correlated match.void
addPlayerPairAndNode
(PlayerPair playerPair, javafx.scene.Node node) Method for adding a Player and a correlated node.boolean
containsPlayer
(Player player) Check if a player is in a Match Columnboolean
containsPlayerPair
(PlayerPair pair) Checks if the Match Column contains a given player pairvoid
createMatchPair
(PlayerPair playerPair, Match match) Method for creating a match pair given a player pair and a match.Collection<javafx.scene.Node>
Method for getting all the nodes in the match columMethod for getting all the Player Pairs.int
getIndex()
Method for getting the column indexMethod for getting the correlating MatchPair given the player pair
-
Constructor Details
-
MatchColumn
public MatchColumn(int col) Constructor for making an instance of the MatchColumn.- Parameters:
col
- index of the column
-
-
Method Details
-
containsPlayer
Check if a player is in a Match Column- Parameters:
player
- to check for- Returns:
-
addPlayerPairAndMatch
Method for adding a Player Pair and a correlated match.- Parameters:
playerPair
- pair to add.match
- to add.
-
addPlayerPairAndNode
Method for adding a Player and a correlated node.- Parameters:
playerPair
- pair to addnode
- node to add
-
createMatchPair
Method for creating a match pair given a player pair and a match. The match will be combined with the previous added match One should check if the player pair is already in the match column- Parameters:
playerPair
- to addmatch
- to pair with other
-
getAllNodes
Method for getting all the nodes in the match colum- Returns:
- the nodes
-
getIndex
public int getIndex()Method for getting the column index- Returns:
- the index
-
containsPlayerPair
Checks if the Match Column contains a given player pair- Parameters:
pair
- to check for- Returns:
- true if yes
-
getMatchPairByPlayerPair
Method for getting the correlating MatchPair given the player pair- Parameters:
pair
- to get the match form- Returns:
- the MatchPair
- Throws:
NoSuchElementException
- if the PlayerPair is not in the MatchColumn
-
getAllPlayerPairs
Method for getting all the Player Pairs.- Returns:
-