Class GroupManager
java.lang.Object
games.stendhal.server.core.rp.group.GroupManager
- All Implemented Interfaces:
LoginListener
,TurnListener
manages player groups
- Author:
- hendrik
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clean()
handles timeouts and removes empty groupscreateGroup(String playerName)
Creates a new groupboolean
destroyGroup(String playerName)
destroys a groupreturns the group the specified player is a member of.void
onLoggedIn(Player player)
tell the reconnecting client if he is in a groupvoid
onTurnReached(int currentTurn)
cleans up
-
Constructor Details
-
GroupManager
public GroupManager()creates a new GroupManager.
-
-
Method Details
-
getGroup
returns the group the specified player is a member of.- Parameters:
playerName
- name of player- Returns:
- Group or
null
if the player is not a member of any group
-
createGroup
Creates a new group- Parameters:
playerName
- name of player- Returns:
- the new group or
null
if the group could not be created
-
destroyGroup
destroys a group- Parameters:
playerName
- name of player- Returns:
- true, if the group was destroyed; false otherwise
-
clean
public void clean()handles timeouts and removes empty groups -
onTurnReached
public void onTurnReached(int currentTurn)cleans up- Specified by:
onTurnReached
in interfaceTurnListener
- Parameters:
currentTurn
- current turn number
-
onLoggedIn
tell the reconnecting client if he is in a group- Specified by:
onLoggedIn
in interfaceLoginListener
- Parameters:
player
- the player who has logged in
-