Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pl.kopara.kguild.tablist.update;
- import java.util.ArrayList;
- import java.util.Collection;
- import java.util.Collections;
- import java.util.List;
- import pl.kopara.kguild.data.base.Guild;
- import pl.kopara.kguild.data.base.User;
- public class RankList
- {
- private static List<Data<User>> topPlayers;
- private static List<Data<Guild>> topGuilds;
- public RankList()
- {
- topPlayers = Collections.synchronizedList(new ArrayList());
- topGuilds = Collections.synchronizedList(new ArrayList());
- }
- public void setTopPlayers(Collection<Data<User>> data) {
- topPlayers.clear();
- topPlayers.addAll(data);
- }
- public void setTopGuilds(Collection<Data<Guild>> data) {
- topGuilds.clear();
- topGuilds.addAll(data);
- }
- public static List<Data<User>> getTopPlayers() {
- return topPlayers;
- }
- public static List<Data<Guild>> getTopGuilds() {
- return topGuilds;
- }
- public static class Data<T> {
- private T key;
- private int points;
- public T getKey() {
- return this.key;
- }
- public int getPoints() {
- return this.points;
- }
- public Data(T key, int points) {
- this.key = key;
- this.points = points;
- }
- }
- }
Add Comment
Please, Sign In to add comment