2019-03-03 04:51:21 +01:00
|
|
|
package com.massivecraft.factions;
|
|
|
|
|
|
|
|
import com.massivecraft.factions.zcore.persist.json.JSONFPlayers;
|
|
|
|
import org.bukkit.OfflinePlayer;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
|
|
|
import java.util.Collection;
|
|
|
|
|
|
|
|
public abstract class FPlayers {
|
2019-09-15 11:19:06 +02:00
|
|
|
protected static FPlayers instance = getFPlayersImpl();
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
public static FPlayers getInstance() {
|
|
|
|
return instance;
|
|
|
|
}
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
private static FPlayers getFPlayersImpl() {
|
|
|
|
if (Conf.backEnd == Conf.Backend.JSON) {
|
|
|
|
return new JSONFPlayers();
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
public abstract void clean();
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
public abstract Collection<FPlayer> getOnlinePlayers();
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
public abstract FPlayer getByPlayer(Player player);
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
public abstract Collection<FPlayer> getAllFPlayers();
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
public abstract void forceSave();
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
public abstract void forceSave(boolean sync);
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
public abstract FPlayer getByOfflinePlayer(OfflinePlayer player);
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
public abstract FPlayer getById(String string);
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:19:06 +02:00
|
|
|
public abstract void load();
|
2019-03-03 04:51:21 +01:00
|
|
|
}
|