public class TeamManager extends Manager
You may sometimes want to create teams in your game, so that some players are team mates.
A player can only belong to a single team.
| Constructor and Description |
|---|
TeamManager()
Creates a new TeamManager instance.
|
| Modifier and Type | Method and Description |
|---|---|
ImmutableBag<String> |
getPlayers(String team)
Get all players on a team.
|
String |
getTeam(String player)
The the name of the team the given player is in.
|
protected void |
initialize()
Called when the world initializes.
|
void |
removeFromTeam(String player)
Remove a player from his team.
|
void |
setTeam(String player,
String team)
Set the player's team.
|
protected void initialize()
ManagerOverride to implement custom behavior at initialization.
initialize in class Managerpublic String getTeam(String player)
player - the playerpublic void setTeam(String player, String team)
Each player can only be in one team at a time.
player - the playerteam - the team to put the player inpublic ImmutableBag<String> getPlayers(String team)
team - the teampublic void removeFromTeam(String player)
player - the player to removeCopyright © 2014. All Rights Reserved.