2011-10-08 22:03:44 +02:00
|
|
|
package com.massivecraft.factions;
|
|
|
|
|
2014-11-06 01:36:47 +01:00
|
|
|
import com.massivecraft.factions.zcore.persist.json.JSONFPlayers;
|
2014-10-19 07:37:25 +02:00
|
|
|
import org.bukkit.OfflinePlayer;
|
|
|
|
import org.bukkit.entity.Player;
|
2011-10-08 22:03:44 +02:00
|
|
|
|
2014-11-06 01:36:47 +01:00
|
|
|
import java.util.Collection;
|
2014-08-05 17:17:27 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public abstract class FPlayers {
|
|
|
|
protected static FPlayers instance = getFPlayersImpl();
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public abstract void clean();
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public static FPlayers getInstance() {
|
|
|
|
return instance;
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
2011-10-08 22:03:44 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
private static FPlayers getFPlayersImpl() {
|
|
|
|
switch (Conf.backEnd) {
|
|
|
|
case JSON:
|
|
|
|
return new JSONFPlayers();
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
2014-10-19 07:37:25 +02:00
|
|
|
return null;
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
2014-10-19 07:37:25 +02:00
|
|
|
|
|
|
|
public abstract Collection<FPlayer> getOnlinePlayers();
|
|
|
|
|
|
|
|
public abstract FPlayer getByPlayer(Player player);
|
|
|
|
|
|
|
|
public abstract Collection<FPlayer> getAllFPlayers();
|
|
|
|
|
|
|
|
public abstract void forceSave();
|
|
|
|
|
2015-08-07 00:41:37 +02:00
|
|
|
public abstract void forceSave(boolean sync);
|
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public abstract FPlayer getByOfflinePlayer(OfflinePlayer player);
|
|
|
|
|
|
|
|
public abstract FPlayer getById(String string);
|
|
|
|
|
|
|
|
public abstract void load();
|
2011-10-08 22:03:44 +02:00
|
|
|
}
|