package com.massivecraft.factions.entity; import java.util.ArrayList; import java.util.List; import com.massivecraft.factions.Const; import com.massivecraft.factions.Factions; import com.massivecraft.massivecore.store.Coll; import com.massivecraft.massivecore.store.MStore; public class MFlagColl extends Coll { // -------------------------------------------- // // INSTANCE & CONSTRUCT // -------------------------------------------- // private static MFlagColl i = new MFlagColl(); public static MFlagColl get() { return i; } private MFlagColl() { super(Const.COLLECTION_MFLAG, MFlag.class, MStore.getDb(), Factions.get()); this.setLowercasing(true); } // -------------------------------------------- // // STACK TRACEABILITY // -------------------------------------------- // @Override public void onTick() { super.onTick(); } // -------------------------------------------- // // OVERRIDE // -------------------------------------------- // @Override public void setActive(boolean active) { super.setActive(active); if ( ! active) return; MFlag.setupStandardFlags(); } // -------------------------------------------- // // EXTRAS // -------------------------------------------- // public List getAll(boolean registered) { List ret = new ArrayList(); for (MFlag mflag : this.getAll()) { if (mflag.isRegistered() != registered) continue; ret.add(mflag); } return ret; } }