Class PlayerList

java.lang.Object
games.stendhal.server.core.engine.PlayerList

public class PlayerList extends Object
Manages the list of online players.
Author:
durkham
  • Constructor Details

    • PlayerList

      public PlayerList()
      Creates a new PlayerList.
  • Method Details

    • forAllPlayersExecute

      public void forAllPlayersExecute(Task<Player> task)
      Calls the execute method of task for each player in this List.
      Parameters:
      task - the task to execute
    • forFilteredPlayersExecute

      public void forFilteredPlayersExecute(Task<Player> task, FilterCriteria<Player> filter)
      Calls the execute method of task for all player in this list that return true in filter.
      Parameters:
      task - the task to execute.
      filter - the FilterCriteria to pass
    • size

      public int size()
      The amount of currently logged in players.
      Returns:
      the amount Player items in this list.
    • add

      public void add(Player player)
      adds a player
      Parameters:
      player - player
    • remove

      public boolean remove(Player player)
      removes a player
      Parameters:
      player - player
      Returns:
      true, if the player was in the list
    • getAllPlayers

      public Collection<Player> getAllPlayers()
      gets a mutable list of all players
      Returns:
      list of all players