public class Game
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.HashMap<java.lang.String,Game> |
games |
Constructor and Description |
---|
Game(java.lang.String name)
Create a new game
|
Modifier and Type | Method and Description |
---|---|
void |
addPlayer(org.bukkit.entity.Player player)
Add a player to your game
|
void |
addTeam(Team team)
Add a team to your game
|
java.lang.Integer |
getCurrentState() |
java.lang.String |
getDisplayName() |
static Game |
getGameOfPlayer(org.bukkit.entity.Player player)
Return the game where the player is.
|
java.lang.String |
getJoinMessageAllPlayers() |
java.lang.String |
getJoinMessagePlayer() |
java.lang.String |
getLeaveMessageAllPlayers() |
java.lang.String |
getLeaveMessagePlayer() |
org.bukkit.Location |
getLobby() |
java.lang.String |
getLosePointMessageAllPlayers() |
java.lang.String |
getLosePointMessagePlayer() |
java.lang.Integer |
getMaxPlayer() |
java.lang.Integer |
getMaxPoints() |
java.lang.Integer |
getMinPlayer() |
java.lang.String |
getName() |
org.bukkit.entity.Player[] |
getPlayers() |
org.bukkit.Location |
getSpawn() |
java.lang.String |
getStartedState() |
Team |
getTeam(java.lang.String team) |
Team |
getTeamOfPlayer(org.bukkit.entity.Player player)
Return the team where the player is.
|
Team[] |
getTeams() |
java.lang.String |
getUnavailableState() |
java.lang.String |
getWaitingState() |
java.lang.String |
getWinPointMessageAllPlayers() |
java.lang.String |
getWinPointMessagePlayer() |
org.bukkit.World |
getWorld() |
java.lang.Boolean |
hasPlayer(org.bukkit.entity.Player player) |
void |
removePlayer(org.bukkit.entity.Player player)
Remove a player from your game
|
void |
removeTeam(java.lang.String team)
Remove a team from your game
|
void |
setCurrentState(java.lang.Integer currentState)
Set a new state to your game
|
void |
setDisplayName(java.lang.String displayName)
Set the display name of your game
|
void |
setJoinMessageAllPlayers(java.lang.String joinMessage)
Set the "join" message for all players.
|
void |
setJoinMessagePlayer(java.lang.String joinMessagePlayer)
Set the "join" message for the player.
|
void |
setLeaveMessageAllPlayers(java.lang.String leaveMessage)
Set the "leave" message for all players.
|
void |
setLeaveMessagePlayer(java.lang.String leaveMessagePlayer)
Set the "leave" message for the player.
|
void |
setLobby(org.bukkit.Location lobby)
Set the location of the lobby of your game.
|
void |
setLosePointMessageAllPlayers(java.lang.String losePointMessageAllPlayers)
Set the "lose point" message for all players.
|
void |
setLosePointMessagePlayer(java.lang.String losePointMessagePlayer)
Set the "lose point" message for the player.
|
void |
setMaxPlayer(java.lang.Integer maxPlayer)
Set the maximum of player that your game require before start
|
void |
setMaxPoints(java.lang.Integer maxPoints)
Set the amount of points to finish the game.
|
void |
setMinPlayer(java.lang.Integer minPlayer)
Set the minimum of player that your game require before start
|
void |
setName(java.lang.String name)
Set the name of your game
|
void |
setSpawn(org.bukkit.Location spawn)
Set the location of the spawn of your game.
|
void |
setStartedState(java.lang.String startedState)
Set the "started" message.
|
void |
setUnavailableState(java.lang.String unavailableState)
Set the "unavailable" message.
|
void |
setWaitingState(java.lang.String waitingState)
Set the "waiting" message.
|
void |
setWinPointMessageAllPlayers(java.lang.String winPointMessageAllPlayers)
Set the "win point" message for all players.
|
void |
setWinPointMessagePlayer(java.lang.String winPointMessagePlayer)
Set the "win point" message for the player.
|
void |
setWorld(org.bukkit.World world)
Set the world of your game
|
java.lang.Boolean |
teamExists(java.lang.String team) |
public static java.util.HashMap<java.lang.String,Game> games
public Game(java.lang.String name)
name
- The name of your gamepublic static Game getGameOfPlayer(org.bukkit.entity.Player player)
player
- The player that we need to know the game where he is.public Team getTeamOfPlayer(org.bukkit.entity.Player player)
player
- The player that we need to know the team where he is.public java.lang.String getName()
public void setName(java.lang.String name)
name
- The name of your gamepublic java.lang.String getDisplayName()
public void setDisplayName(java.lang.String displayName)
displayName
- The display name of your gamepublic java.lang.Integer getMinPlayer()
public void setMinPlayer(java.lang.Integer minPlayer)
minPlayer
- The minimum of player that your game require before startpublic java.lang.Integer getMaxPlayer()
public void setMaxPlayer(java.lang.Integer maxPlayer)
maxPlayer
- The maximum of player that your game require before startpublic org.bukkit.Location getLobby()
public void setLobby(org.bukkit.Location lobby)
lobby
- Lobby of your gamepublic org.bukkit.Location getSpawn()
public void setSpawn(org.bukkit.Location spawn)
spawn
- The spawn of your gamepublic org.bukkit.entity.Player[] getPlayers()
public void addPlayer(org.bukkit.entity.Player player)
player
- The player who will join the gamepublic Team[] getTeams()
public Team getTeam(java.lang.String team)
public void removePlayer(org.bukkit.entity.Player player)
player
- The player who will leave the gamepublic void addTeam(Team team)
team
- The team which will be addedpublic void removeTeam(java.lang.String team)
team
- The team which will be removed from your gamepublic java.lang.Boolean teamExists(java.lang.String team)
team
- The team that you need to check existencepublic java.lang.Boolean hasPlayer(org.bukkit.entity.Player player)
player
- The player to check if he is in the gamepublic java.lang.String getStartedState()
public void setStartedState(java.lang.String startedState)
startedState
- The "started" message. Will be showed when your game already startedpublic java.lang.String getWaitingState()
public void setWaitingState(java.lang.String waitingState)
waitingState
- The "waiting" message. Will be showed when your game wait more playerspublic java.lang.String getUnavailableState()
public void setUnavailableState(java.lang.String unavailableState)
unavailableState
- The "unavailable" message. Will be showed when your game is not availablepublic java.lang.Integer getCurrentState()
public void setCurrentState(java.lang.Integer currentState)
currentState
- The new state of your gamepublic org.bukkit.World getWorld()
public void setWorld(org.bukkit.World world)
world
- The world of your gamepublic java.lang.String getJoinMessageAllPlayers()
public void setJoinMessageAllPlayers(java.lang.String joinMessage)
joinMessage
- The "join" message. Will be showed when a new player join your game.public java.lang.String getLeaveMessageAllPlayers()
public void setLeaveMessageAllPlayers(java.lang.String leaveMessage)
leaveMessage
- The "leave" message. Will be showed when a player leave your game.public java.lang.String getJoinMessagePlayer()
public void setJoinMessagePlayer(java.lang.String joinMessagePlayer)
joinMessagePlayer
- The "join" message. Will be showed when the player joins your game.public java.lang.String getLeaveMessagePlayer()
public void setLeaveMessagePlayer(java.lang.String leaveMessagePlayer)
leaveMessagePlayer
- The "leave" message. Will be showed when the player leaves your game.public java.lang.String getWinPointMessageAllPlayers()
public void setWinPointMessageAllPlayers(java.lang.String winPointMessageAllPlayers)
winPointMessageAllPlayers
- The "win point" message. Will be showed when a player has scored a pointpublic java.lang.String getWinPointMessagePlayer()
public void setWinPointMessagePlayer(java.lang.String winPointMessagePlayer)
winPointMessagePlayer
- The "win point" message. Will be showed when the player score a pointpublic java.lang.String getLosePointMessageAllPlayers()
public void setLosePointMessageAllPlayers(java.lang.String losePointMessageAllPlayers)
losePointMessageAllPlayers
- The "win point" message. Will be showed when a player lose a pointpublic java.lang.String getLosePointMessagePlayer()
public void setLosePointMessagePlayer(java.lang.String losePointMessagePlayer)
losePointMessagePlayer
- The "win point" message. Will be showed when the player lose a pointpublic java.lang.Integer getMaxPoints()
public void setMaxPoints(java.lang.Integer maxPoints)
maxPoints
- Amount of points to finish the game.