2018-10-31 14:09:56 +01:00
|
|
|
package world.bentobox.level.objects;
|
2017-10-25 01:24:43 +02:00
|
|
|
|
2018-04-03 03:20:26 +02:00
|
|
|
import java.util.LinkedHashMap;
|
2020-06-22 02:54:51 +02:00
|
|
|
import java.util.Locale;
|
2017-10-25 01:24:43 +02:00
|
|
|
import java.util.Map;
|
|
|
|
import java.util.UUID;
|
|
|
|
|
2020-06-22 02:54:51 +02:00
|
|
|
import org.bukkit.World;
|
2020-04-20 00:17:34 +02:00
|
|
|
|
2018-03-11 20:06:31 +01:00
|
|
|
import com.google.gson.annotations.Expose;
|
|
|
|
|
2018-08-01 18:49:43 +02:00
|
|
|
import world.bentobox.bentobox.database.objects.DataObject;
|
2020-06-11 05:49:28 +02:00
|
|
|
import world.bentobox.bentobox.database.objects.Table;
|
2017-10-25 01:24:43 +02:00
|
|
|
|
|
|
|
/**
|
2020-06-22 02:54:51 +02:00
|
|
|
* This class stores the top ten.
|
2020-05-02 01:43:09 +02:00
|
|
|
* @author tastybento
|
2017-10-25 01:24:43 +02:00
|
|
|
*
|
|
|
|
*/
|
2020-06-11 05:49:28 +02:00
|
|
|
@Table(name = "TopTenData")
|
2018-01-07 20:25:24 +01:00
|
|
|
public class TopTenData implements DataObject {
|
2018-08-26 06:15:45 +02:00
|
|
|
|
2018-05-26 04:59:44 +02:00
|
|
|
// UniqueId is the world name
|
2018-03-11 20:06:31 +01:00
|
|
|
@Expose
|
2018-05-26 04:59:44 +02:00
|
|
|
private String uniqueId = "";
|
2018-03-11 20:06:31 +01:00
|
|
|
@Expose
|
2018-04-03 03:20:26 +02:00
|
|
|
private Map<UUID, Long> topTen = new LinkedHashMap<>();
|
2017-10-25 01:24:43 +02:00
|
|
|
|
2020-06-22 02:54:51 +02:00
|
|
|
public TopTenData(World k) {
|
|
|
|
uniqueId = k.getName().toLowerCase(Locale.ENGLISH);
|
2017-10-25 01:24:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getUniqueId() {
|
2019-07-06 20:45:58 +02:00
|
|
|
// This is the world name
|
2017-10-25 01:24:43 +02:00
|
|
|
return uniqueId;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setUniqueId(String uniqueId) {
|
2019-07-06 20:45:58 +02:00
|
|
|
// This is the world name - make it always lowercase
|
2020-06-22 02:54:51 +02:00
|
|
|
this.uniqueId = uniqueId.toLowerCase(Locale.ENGLISH);
|
2017-10-25 01:24:43 +02:00
|
|
|
}
|
|
|
|
/**
|
2020-06-22 02:54:51 +02:00
|
|
|
* @return the topTen
|
2017-10-25 01:24:43 +02:00
|
|
|
*/
|
2020-06-22 02:54:51 +02:00
|
|
|
public Map<UUID, Long> getTopTen() {
|
|
|
|
return topTen;
|
2017-10-25 01:24:43 +02:00
|
|
|
}
|
|
|
|
/**
|
2020-06-22 02:54:51 +02:00
|
|
|
* @param topTen the topTen to set
|
2017-10-25 01:24:43 +02:00
|
|
|
*/
|
2020-06-22 02:54:51 +02:00
|
|
|
public void setTopTen(Map<UUID, Long> topTen) {
|
|
|
|
this.topTen = topTen;
|
2017-10-25 01:24:43 +02:00
|
|
|
}
|
|
|
|
|
2018-08-26 06:15:45 +02:00
|
|
|
|
2017-10-25 01:24:43 +02:00
|
|
|
}
|