From ea7d0f83050eb23a4145cef7f76e894fea7fb333 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Thu, 11 Apr 2013 12:32:38 +0200 Subject: [PATCH] Adding in future load method. --- src/com/massivecraft/factions/Faction.java | 26 +++++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/com/massivecraft/factions/Faction.java b/src/com/massivecraft/factions/Faction.java index 6e91f9dd..f81e7b52 100644 --- a/src/com/massivecraft/factions/Faction.java +++ b/src/com/massivecraft/factions/Faction.java @@ -35,8 +35,16 @@ public class Faction extends Entity implements EconomyParticipator /*@Override public Faction load(Faction that) { - //this.item = that.item; - // TODO + this.relationWish = that.relationWish; + this.invitedPlayerIds = that.invitedPlayerIds; + this.open = that.open; + this.tag = that.tag; + this.description = that.description; + this.home = that.home; + this.cape = that.cape; + this.powerBoost = that.powerBoost; + this.flagOverrides = that.flagOverrides; + this.permOverrides = that.permOverrides; return this; }*/ @@ -62,17 +70,20 @@ public class Faction extends Entity implements EconomyParticipator } public void setInvitedPlayerIds(Collection invitedPlayerIds) { - TreeSet target = new TreeSet(String.CASE_INSENSITIVE_ORDER); - - if (invitedPlayerIds != null) + if (invitedPlayerIds == null || invitedPlayerIds.isEmpty()) { + this.invitedPlayerIds = null; + } + else + { + TreeSet target = new TreeSet(String.CASE_INSENSITIVE_ORDER); for (String invitedPlayerId : invitedPlayerIds) { target.add(invitedPlayerId.toLowerCase()); } + this.invitedPlayerIds = target; } - this.invitedPlayerIds = target; // TODO: Add when we use a true mcore entity. // this.changed(); } @@ -154,6 +165,9 @@ public class Faction extends Entity implements EconomyParticipator // FIELDS: Flag management // TODO: This will save... defaults if they where changed to... + + + private Map flagOverrides; // Contains the modifications to the default values public boolean getFlag(FFlag flag) {