Class PlayerList
java.lang.Object
games.stendhal.server.core.engine.PlayerList
Manages the list of online players.
- Author:
- durkham
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
adds a playervoid
forAllPlayersExecute(Task<Player> task)
Calls the execute method of task for each player in this List.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.gets a mutable list of all playersboolean
removes a playerint
size()
The amount of currently logged in players.
-
Constructor Details
-
PlayerList
public PlayerList()Creates a new PlayerList.
-
-
Method Details
-
forAllPlayersExecute
Calls the execute method of task for each player in this List.- Parameters:
task
- the task to execute
-
forFilteredPlayersExecute
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
adds a player- Parameters:
player
- player
-
remove
removes a player- Parameters:
player
- player- Returns:
- true, if the player was in the list
-
getAllPlayers
gets a mutable list of all players- Returns:
- list of all players
-