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.JSONFactions;
|
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
import java.util.ArrayList;
|
2014-10-19 07:37:25 +02:00
|
|
|
import java.util.Set;
|
2011-10-08 22:03:44 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public abstract class Factions {
|
|
|
|
protected static Factions instance = getFactionsImpl();
|
2011-10-08 22:03:44 +02:00
|
|
|
|
2018-07-12 18:11:07 +02:00
|
|
|
public static Factions getInstance() {
|
|
|
|
return instance;
|
|
|
|
}
|
|
|
|
|
|
|
|
private static Factions getFactionsImpl() {
|
|
|
|
switch (Conf.backEnd) {
|
|
|
|
case JSON:
|
|
|
|
return new JSONFactions();
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public abstract Faction getFactionById(String id);
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public abstract Faction getByTag(String str);
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public abstract Faction getBestTagMatch(String start);
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public abstract boolean isTagTaken(String str);
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public abstract boolean isValidFactionId(String id);
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public abstract Faction createFaction();
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public abstract void removeFaction(String id);
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public abstract Set<String> getFactionTags();
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public abstract ArrayList<Faction> getAllFactions();
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2015-07-23 21:39:50 +02:00
|
|
|
@Deprecated
|
2014-10-19 07:37:25 +02:00
|
|
|
public abstract Faction getNone();
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2015-07-23 21:39:50 +02:00
|
|
|
public abstract Faction getWilderness();
|
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public abstract Faction getSafeZone();
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public abstract Faction getWarZone();
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public abstract void forceSave();
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2015-08-07 00:41:37 +02:00
|
|
|
public abstract void forceSave(boolean sync);
|
|
|
|
|
2014-10-19 07:37:25 +02:00
|
|
|
public abstract void load();
|
2011-10-08 22:03:44 +02:00
|
|
|
}
|