Class 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 index
      void setScores​(int[] scores)
      Sets the scores of all players in the list
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 to
        playerNames - The names of the players
        playerColors - The colors chosen for the players
        playerTypes - 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