Package com.minigameworldrank.data
Class RankData
java.lang.Object
com.minigameworldrank.data.RankData
- All Implemented Interfaces:
Cloneable,Comparable<RankData>,org.bukkit.configuration.serialization.ConfigurationSerializable
public class RankData
extends Object
implements org.bukkit.configuration.serialization.ConfigurationSerializable, Comparable<RankData>, Cloneable
Contains rank in the config, score, played players
Sorted by score when a pluing loaded or new RankData saved
Sorted by score when a pluing loaded or new RankData saved
-
Constructor Summary
ConstructorsConstructorDescriptionRankData(int rank, int score, List<PlayerData> players)For serialization constructorRankData(com.minigameworld.frames.helpers.MiniGameRankResult comp)Extracts info from MiniGameRankComparable -
Method Summary
Modifier and TypeMethodDescriptionclone()intbooleancontainsPlayer(org.bukkit.entity.Player p)Check this rank data is related with a playerstatic RankDatadeserialize(Map<String,Object> data)Deserialize methodGets played player listintgetRank()Gets rankintgetScore()Gets scorebooleanisSamePlayers(List<org.bukkit.entity.Player> otherPlayers)Check this rank data is related with this all playersvoidsetRank(int rank)Sets Rank (with API, not applied)toString()
-
Constructor Details
-
RankData
public RankData(com.minigameworld.frames.helpers.MiniGameRankResult comp)Extracts info from MiniGameRankComparable- Parameters:
comp- MiniGameRankComparable
-
RankData
For serialization constructor- Parameters:
rank-score-players-
-
-
Method Details
-
serialize
- Specified by:
serializein interfaceorg.bukkit.configuration.serialization.ConfigurationSerializable
-
deserialize
Deserialize method- Parameters:
data-- Returns:
-
getRank
public int getRank()Gets rank- Returns:
- Rank
-
setRank
public void setRank(int rank)Sets Rank (with API, not applied)- Parameters:
rank- Rank
-
getPlayers
Gets played player list- Returns:
- Player list
-
getScore
public int getScore()Gets score- Returns:
-
compareTo
- Specified by:
compareToin interfaceComparable<RankData>
-
containsPlayer
public boolean containsPlayer(org.bukkit.entity.Player p)Check this rank data is related with a player- Parameters:
p- Player to check- Returns:
- True if rank data related with a player
-
isSamePlayers
Check this rank data is related with this all players- Parameters:
otherPlayers- Players to check- Returns:
- True if all of players are related with the rank data
-
toString
-
clone
-