Adding in future load method.

This commit is contained in:
Olof Larsson 2013-04-11 12:32:38 +02:00
parent 6f897e15ff
commit ea7d0f8305

View File

@ -35,8 +35,16 @@ public class Faction extends Entity implements EconomyParticipator
/*@Override /*@Override
public Faction load(Faction that) public Faction load(Faction that)
{ {
//this.item = that.item; this.relationWish = that.relationWish;
// TODO 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; return this;
}*/ }*/
@ -62,17 +70,20 @@ public class Faction extends Entity implements EconomyParticipator
} }
public void setInvitedPlayerIds(Collection<String> invitedPlayerIds) public void setInvitedPlayerIds(Collection<String> invitedPlayerIds)
{ {
TreeSet<String> target = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER); if (invitedPlayerIds == null || invitedPlayerIds.isEmpty())
if (invitedPlayerIds != null)
{ {
this.invitedPlayerIds = null;
}
else
{
TreeSet<String> target = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
for (String invitedPlayerId : invitedPlayerIds) for (String invitedPlayerId : invitedPlayerIds)
{ {
target.add(invitedPlayerId.toLowerCase()); target.add(invitedPlayerId.toLowerCase());
} }
this.invitedPlayerIds = target;
} }
this.invitedPlayerIds = target;
// TODO: Add when we use a true mcore entity. // TODO: Add when we use a true mcore entity.
// this.changed(); // this.changed();
} }
@ -154,6 +165,9 @@ public class Faction extends Entity implements EconomyParticipator
// FIELDS: Flag management // FIELDS: Flag management
// TODO: This will save... defaults if they where changed to... // TODO: This will save... defaults if they where changed to...
private Map<FFlag, Boolean> flagOverrides; // Contains the modifications to the default values private Map<FFlag, Boolean> flagOverrides; // Contains the modifications to the default values
public boolean getFlag(FFlag flag) public boolean getFlag(FFlag flag)
{ {