public class Players
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static Players |
players |
private static java.util.LinkedList<Player> |
thePlayers |
Constructor and Description |
---|
Players() |
Modifier and Type | Method and Description |
---|---|
void |
addPlayer(Player newPlayer)
Adds a new player to the player object
|
java.lang.String |
getGameScores()
Prints out the scoreboard after the round and game is over
|
int |
getHighestScore()
Returns the highest score
Used to check if the highest score is over the game winning value
|
Player |
getHighestScoringPlayer()
Returns the highest scored player
Used to check if the highest score is over the game winning value
|
static Players |
getInstanceOf()
Returns the Player object.
|
Player |
getPlayer(int idx)
Gets a specific player in the linked list
|
java.util.LinkedList<Player> |
getPlayers()
Returns the Linked List of Player objects.
|
java.lang.String |
getWinner()
Returns the name of the game winning player or No Winner if there was
no winner
|
void |
reset()
Empties the players rack and recreates it to the rack size variable
Sets won_round to false
|
public static final Players players
private static final java.util.LinkedList<Player> thePlayers
public static Players getInstanceOf()
public java.util.LinkedList<Player> getPlayers()
Player
public Player getPlayer(int idx)
idx
- Index of the playerPlayer
public void addPlayer(Player newPlayer)
newPlayer
- A new PlayerPlayer
public void reset()
Player
,
Player.initializeRack()
,
Racko.rack_size
public int getHighestScore()
Player
,
Player.getPlayerScore()
public Player getHighestScoringPlayer()
Player
,
Player.getPlayerScore()
public java.lang.String getGameScores()
Player
,
Player.getPlayerName()
,
Player.getPlayerScore()
public java.lang.String getWinner()