2014-10-02 11:45:06 +02:00
|
|
|
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<MFlag>
|
|
|
|
{
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// INSTANCE & CONSTRUCT
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
private static MFlagColl i = new MFlagColl();
|
|
|
|
public static MFlagColl get() { return i; }
|
|
|
|
private MFlagColl()
|
|
|
|
{
|
2015-12-01 11:23:47 +01:00
|
|
|
super(Const.COLLECTION_MFLAG, MFlag.class, MStore.getDb(), Factions.get());
|
|
|
|
this.setLowercasing(true);
|
2014-10-02 11:45:06 +02:00
|
|
|
}
|
2015-02-02 00:25:29 +01:00
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// STACK TRACEABILITY
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onTick()
|
|
|
|
{
|
|
|
|
super.onTick();
|
|
|
|
}
|
2014-10-02 11:45:06 +02:00
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// OVERRIDE
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
@Override
|
2016-02-25 22:28:09 +01:00
|
|
|
public void setActive(boolean active)
|
2014-10-02 11:45:06 +02:00
|
|
|
{
|
2016-02-25 22:28:09 +01:00
|
|
|
super.setActive(active);
|
|
|
|
if ( ! active) return;
|
2014-10-02 11:45:06 +02:00
|
|
|
MFlag.setupStandardFlags();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// EXTRAS
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
public List<MFlag> getAll(boolean registered)
|
|
|
|
{
|
|
|
|
List<MFlag> ret = new ArrayList<MFlag>();
|
|
|
|
for (MFlag mflag : this.getAll())
|
|
|
|
{
|
|
|
|
if (mflag.isRegistered() != registered) continue;
|
|
|
|
ret.add(mflag);
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|