MassiveCore - Automatic Collection Constructors

This commit is contained in:
Olof Larsson 2016-06-23 11:54:41 +02:00
parent e88270d0cd
commit 4165d4e01f
No known key found for this signature in database
GPG Key ID: BBEF14F97DA52474
8 changed files with 3 additions and 36 deletions

View File

@ -22,7 +22,7 @@ public class Const
public static final int MAP_HEIGHT = 8; public static final int MAP_HEIGHT = 8;
public static final int MAP_HEIGHT_FULL = 17; public static final int MAP_HEIGHT_FULL = 17;
public static final char[] MAP_KEY_CHARS = "\\/#?笣$%=&^ABCDEFGHJKLMNOPQRSTUVWXYZÄÖÜÆØÅ1234567890abcdeghjmnopqrsuvwxyÿzäöüæøåâêîûô".toCharArray(); public static final char[] MAP_KEY_CHARS = "\\/#?笣$%=&^ABCDEFGHJKLMNOPQRSTUVWXYZ<59><5A><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1234567890abcdeghjmnopqrsuvwxy<78>z<EFBFBD><7A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>".toCharArray();
public static final String MAP_KEY_WILDERNESS = ChatColor.GRAY.toString() + "-"; public static final String MAP_KEY_WILDERNESS = ChatColor.GRAY.toString() + "-";
public static final String MAP_KEY_SEPARATOR = ChatColor.AQUA.toString() + "+"; public static final String MAP_KEY_SEPARATOR = ChatColor.AQUA.toString() + "+";
public static final String MAP_KEY_OVERFLOW = ChatColor.MAGIC.toString() + "-" + ChatColor.RESET.toString(); public static final String MAP_KEY_OVERFLOW = ChatColor.MAGIC.toString() + "-" + ChatColor.RESET.toString();

View File

@ -9,15 +9,12 @@ import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Set; import java.util.Set;
import com.massivecraft.factions.Const;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.RelationParticipator; import com.massivecraft.factions.RelationParticipator;
import com.massivecraft.factions.TerritoryAccess; import com.massivecraft.factions.TerritoryAccess;
import com.massivecraft.massivecore.collections.MassiveMap; import com.massivecraft.massivecore.collections.MassiveMap;
import com.massivecraft.massivecore.collections.MassiveSet; import com.massivecraft.massivecore.collections.MassiveSet;
import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.ps.PS;
import com.massivecraft.massivecore.store.Coll; import com.massivecraft.massivecore.store.Coll;
import com.massivecraft.massivecore.store.MStore;
import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.MUtil;
public class BoardColl extends Coll<Board> implements BoardInterface public class BoardColl extends Coll<Board> implements BoardInterface
@ -30,7 +27,6 @@ public class BoardColl extends Coll<Board> implements BoardInterface
public static BoardColl get() { return i; } public static BoardColl get() { return i; }
private BoardColl() private BoardColl()
{ {
super(Const.COLLECTION_BOARD, Board.class, MStore.getDb(), Factions.get());
this.setCreative(true); this.setCreative(true);
this.setLowercasing(true); this.setLowercasing(true);
} }

View File

@ -3,9 +3,7 @@ package com.massivecraft.factions.entity;
import java.util.*; import java.util.*;
import com.massivecraft.massivecore.store.Coll; import com.massivecraft.massivecore.store.Coll;
import com.massivecraft.massivecore.store.MStore;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
import com.massivecraft.factions.Const;
import com.massivecraft.factions.Factions; import com.massivecraft.factions.Factions;
import com.massivecraft.factions.Rel; import com.massivecraft.factions.Rel;
import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.integration.Econ;
@ -19,10 +17,6 @@ public class FactionColl extends Coll<Faction>
private static FactionColl i = new FactionColl(); private static FactionColl i = new FactionColl();
public static FactionColl get() { return i; } public static FactionColl get() { return i; }
private FactionColl()
{
super(Const.COLLECTION_FACTION, Faction.class, MStore.getDb(), Factions.get());
}
// -------------------------------------------- // // -------------------------------------------- //
// STACK TRACEABILITY // STACK TRACEABILITY

View File

@ -1,10 +1,7 @@
package com.massivecraft.factions.entity; package com.massivecraft.factions.entity;
import com.massivecraft.factions.Const;
import com.massivecraft.factions.Factions;
import com.massivecraft.massivecore.MassiveCore; import com.massivecraft.massivecore.MassiveCore;
import com.massivecraft.massivecore.store.Coll; import com.massivecraft.massivecore.store.Coll;
import com.massivecraft.massivecore.store.MStore;
public class MConfColl extends Coll<MConf> public class MConfColl extends Coll<MConf>
{ {
@ -14,10 +11,6 @@ public class MConfColl extends Coll<MConf>
private static MConfColl i = new MConfColl(); private static MConfColl i = new MConfColl();
public static MConfColl get() { return i; } public static MConfColl get() { return i; }
private MConfColl()
{
super(Const.COLLECTION_MCONF, MConf.class, MStore.getDb(), Factions.get());
}
// -------------------------------------------- // // -------------------------------------------- //
// STACK TRACEABILITY // STACK TRACEABILITY

View File

@ -3,10 +3,7 @@ package com.massivecraft.factions.entity;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; 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.Coll;
import com.massivecraft.massivecore.store.MStore;
public class MFlagColl extends Coll<MFlag> public class MFlagColl extends Coll<MFlag>
{ {
@ -18,7 +15,6 @@ public class MFlagColl extends Coll<MFlag>
public static MFlagColl get() { return i; } public static MFlagColl get() { return i; }
private MFlagColl() private MFlagColl()
{ {
super(Const.COLLECTION_MFLAG, MFlag.class, MStore.getDb(), Factions.get());
this.setLowercasing(true); this.setLowercasing(true);
} }

View File

@ -3,10 +3,7 @@ package com.massivecraft.factions.entity;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; 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.Coll;
import com.massivecraft.massivecore.store.MStore;
public class MPermColl extends Coll<MPerm> public class MPermColl extends Coll<MPerm>
{ {
@ -18,7 +15,6 @@ public class MPermColl extends Coll<MPerm>
public static MPermColl get() { return i; } public static MPermColl get() { return i; }
private MPermColl() private MPermColl()
{ {
super(Const.COLLECTION_MPERM, MPerm.class, MStore.getDb(), Factions.get());
this.setLowercasing(true); this.setLowercasing(true);
} }

View File

@ -4,9 +4,7 @@ import java.util.Collection;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import com.massivecraft.factions.Const;
import com.massivecraft.factions.Factions; import com.massivecraft.factions.Factions;
import com.massivecraft.massivecore.store.MStore;
import com.massivecraft.massivecore.store.SenderColl; import com.massivecraft.massivecore.store.SenderColl;
import com.massivecraft.massivecore.util.IdUtil; import com.massivecraft.massivecore.util.IdUtil;
import com.massivecraft.massivecore.util.Txt; import com.massivecraft.massivecore.util.Txt;
@ -19,10 +17,6 @@ public class MPlayerColl extends SenderColl<MPlayer>
private static MPlayerColl i = new MPlayerColl(); private static MPlayerColl i = new MPlayerColl();
public static MPlayerColl get() { return i; } public static MPlayerColl get() { return i; }
private MPlayerColl()
{
super(Const.COLLECTION_MPLAYER, MPlayer.class, MStore.getDb(), Factions.get());
}
// -------------------------------------------- // // -------------------------------------------- //
// STACK TRACEABILITY // STACK TRACEABILITY

View File

@ -1,9 +1,7 @@
package com.massivecraft.factions.update; package com.massivecraft.factions.update;
import com.massivecraft.factions.Factions;
import com.massivecraft.massivecore.MassiveCore; import com.massivecraft.massivecore.MassiveCore;
import com.massivecraft.massivecore.store.Coll; import com.massivecraft.massivecore.store.Coll;
import com.massivecraft.massivecore.store.MStore;
public class OldConfColl extends Coll<OldConf> public class OldConfColl extends Coll<OldConf>
{ {
@ -11,9 +9,9 @@ public class OldConfColl extends Coll<OldConf>
// CONSTRUCT // CONSTRUCT
// -------------------------------------------- // // -------------------------------------------- //
public OldConfColl(String name) public OldConfColl(String id)
{ {
super(name, OldConf.class, MStore.getDb(), Factions.get()); super(id);
} }
// -------------------------------------------- // // -------------------------------------------- //