Package com.minigameworld.frames.helpers
Class MiniGamePlayer
java.lang.Object
com.minigameworld.frames.helpers.MiniGamePlayer
- All Implemented Interfaces:
MiniGameRank
,Cloneable
,Comparable<MiniGameRank>
Player data with score, live
[IMPORTANT] live is only valid in the minigame play (not related with player's health)
[IMPORTANT] Player state will be saved when a instance is created (in constructor)
[IMPORTANT] live is only valid in the minigame play (not related with player's health)
[IMPORTANT] Player state will be saved when a instance is created (in constructor)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
org.bukkit.entity.Player
Gets a playerList<org.bukkit.entity.Player>
Gets rank playersint
getScore()
Gets player's scoregetState()
Gets player state instanceboolean
isLive()
Check player is live in the minigame playboolean
isSamePlayer(org.bukkit.entity.Player other)
Check player are the samevoid
minusScore(int amount)
Minus player's scorevoid
plusScore(int amount)
Plus player's scorevoid
setLive(boolean live)
Sets player's live in the minigame player
This method will checkMiniGame.checkGameFinishCondition()
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.minigameworld.frames.helpers.MiniGameRank
compareTo
-
Constructor Details
-
MiniGamePlayer
-
-
Method Details
-
getPlayer
public org.bukkit.entity.Player getPlayer()Gets a player- Returns:
- Player
-
isSamePlayer
public boolean isSamePlayer(org.bukkit.entity.Player other)Check player are the same- Parameters:
other
- Other player- Returns:
- True if the same player
-
getScore
public int getScore()Gets player's score- Specified by:
getScore
in interfaceMiniGameRank
- Returns:
-
plusScore
public void plusScore(int amount)Plus player's score- Parameters:
amount
- Score amount
-
minusScore
public void minusScore(int amount)Minus player's score- Parameters:
amount
- Score amount
-
isLive
public boolean isLive()Check player is live in the minigame play- Returns:
- True if alive
-
setLive
public void setLive(boolean live)Sets player's live in the minigame player
This method will checkMiniGame.checkGameFinishCondition()
- Parameters:
live
- False if make death a player
-
getState
Gets player state instance- Returns:
- MiniGamePlayerState
-
getPlayers
Description copied from interface:MiniGameRank
Gets rank players- Specified by:
getPlayers
in interfaceMiniGameRank
- Returns:
- Players
-
clone
-