Package breitband.GUI.ui
Class PlayerList
- java.lang.Object
-
- breitband.GUI.ui.PlayerList
-
public class PlayerList extends java.lang.Object
The list of all current players.Players are shown in a horizontal list with their scores beneath their avatars.
- Author:
- Luna Otte
-
-
Constructor Summary
Constructors Constructor Description PlayerList(sag.SAGPanel panel, java.lang.String[] playerNames, java.awt.Color[] playerColors, breitband.preset.PlayerType[] playerTypes)
Creates a new PlayerList
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PlayerList
onEnter(java.util.function.Consumer<java.lang.Integer> action)
PlayerList
onExit(java.util.function.Consumer<java.lang.Integer> action)
void
setCurrentPlayer(int currentPlayer)
Sets the current player indexvoid
setScores(int[] scores)
Sets the scores of all players in the list
-
-
-
Constructor Detail
-
PlayerList
public PlayerList(sag.SAGPanel panel, java.lang.String[] playerNames, java.awt.Color[] playerColors, breitband.preset.PlayerType[] playerTypes)
Creates a new PlayerList- Parameters:
panel
- The panel that this list will be attached toplayerNames
- The names of the playersplayerColors
- The colors chosen for the playersplayerTypes
- The types of the players
-
-
Method Detail
-
onEnter
public PlayerList onEnter(java.util.function.Consumer<java.lang.Integer> action)
-
onExit
public PlayerList onExit(java.util.function.Consumer<java.lang.Integer> action)
-
setCurrentPlayer
public void setCurrentPlayer(int currentPlayer)
Sets the current player index- Parameters:
currentPlayer
- The index of the new current player
-
setScores
public void setScores(int[] scores)
Sets the scores of all players in the list- Parameters:
scores
- The new scores of the players
-
-