2019-03-03 04:51:21 +01:00
|
|
|
package com.massivecraft.factions;
|
|
|
|
|
|
|
|
import com.massivecraft.factions.zcore.persist.json.JSONFactions;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
public abstract class Factions {
|
2019-09-15 11:14:14 +02:00
|
|
|
protected static Factions instance = getFactionsImpl();
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:14:14 +02:00
|
|
|
public static Factions getInstance() {
|
|
|
|
return instance;
|
|
|
|
}
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:14:14 +02:00
|
|
|
private static Factions getFactionsImpl() {
|
|
|
|
switch (Conf.backEnd) {
|
|
|
|
case JSON:
|
|
|
|
return new JSONFactions();
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:14:14 +02:00
|
|
|
public abstract Faction getFactionById(String id);
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:14:14 +02:00
|
|
|
public abstract Faction getByTag(String str);
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:14:14 +02:00
|
|
|
public abstract Faction getBestTagMatch(String start);
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:14:14 +02:00
|
|
|
public abstract boolean isTagTaken(String str);
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:14:14 +02:00
|
|
|
public abstract boolean isValidFactionId(String id);
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:14:14 +02:00
|
|
|
public abstract Faction createFaction();
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:14:14 +02:00
|
|
|
public abstract void removeFaction(String id);
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:14:14 +02:00
|
|
|
public abstract Set<String> getFactionTags();
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:14:14 +02:00
|
|
|
public abstract ArrayList<Faction> getAllFactions();
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:14:14 +02:00
|
|
|
@Deprecated
|
|
|
|
public abstract Faction getNone();
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:14:14 +02:00
|
|
|
public abstract Faction getWilderness();
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:14:14 +02:00
|
|
|
public abstract Faction getSafeZone();
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:14:14 +02:00
|
|
|
public abstract Faction getWarZone();
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:14:14 +02:00
|
|
|
public abstract void forceSave();
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:14:14 +02:00
|
|
|
public abstract void forceSave(boolean sync);
|
2019-03-03 04:51:21 +01:00
|
|
|
|
2019-09-15 11:14:14 +02:00
|
|
|
public abstract void load();
|
2019-03-03 04:51:21 +01:00
|
|
|
}
|