Working permdelta parser

This commit is contained in:
Olof Larsson 2011-10-23 23:38:26 +02:00
parent 371261a07f
commit 958a1e0d9f
5 changed files with 7 additions and 6 deletions

View File

@ -165,6 +165,7 @@ public class Faction extends Entity implements EconomyParticipator
//this.peacefulExplosionsEnabled = false; //this.peacefulExplosionsEnabled = false;
this.money = 0.0; this.money = 0.0;
this.flagOverrides = new LinkedHashMap<FactionFlag, Boolean>(); this.flagOverrides = new LinkedHashMap<FactionFlag, Boolean>();
this.permOverrides = new LinkedHashMap<FactionPerm, Set<Rel>>();
} }

View File

@ -37,7 +37,7 @@ public class CmdDescription extends FCommand
// Broadcast the description to everyone // Broadcast the description to everyone
for (FPlayer fplayer : FPlayers.i.getOnline()) for (FPlayer fplayer : FPlayers.i.getOnline())
{ {
fplayer.msg("<i>The faction %s<i> changed their description to:", myFaction.describeTo(fplayer)); fplayer.msg("<h>%s<i> changed their description to:", myFaction.describeTo(fplayer));
fplayer.msg("<h>"+myFaction.getDescription()); fplayer.msg("<h>"+myFaction.getDescription());
} }
} }

View File

@ -62,7 +62,7 @@ public class CmdPerm extends FCommand
} }
// TODO: Awesomesause parser for deltas... // TODO: Awesomesause parser for deltas...
Set<Rel> targetValue = FactionPerm.parseRelDeltas(TextUtil.implode(args.subList(2, args.size()-1), " "), faction.getPerm(perm)); Set<Rel> targetValue = FactionPerm.parseRelDeltas(TextUtil.implode(args.subList(2, args.size()), " "), faction.getPerm(perm));
// Do the sender have the right to change perms for this faction? // Do the sender have the right to change perms for this faction?
if (Permission.PERM_ANY.has(sender)) if (Permission.PERM_ANY.has(sender))

View File

@ -91,7 +91,7 @@ public enum FactionFlag
public String getStateInfo(boolean value, boolean withDesc) public String getStateInfo(boolean value, boolean withDesc)
{ {
String ret = (value ? "<g>YES" : "<b>NOT") + "<h> " + this.getNicename(); String ret = (value ? "<g>YES" : "<b>NOO") + "<h> " + this.getNicename();
if (withDesc) if (withDesc)
{ {
ret += " " + this.getDescription(); ret += " " + this.getDescription();

View File

@ -71,13 +71,13 @@ public enum FactionPerm
List<String> rels = new ArrayList<String>(); List<String> rels = new ArrayList<String>();
for (Rel rel : value) for (Rel rel : value)
{ {
rels.add("<i>"+rel.nicename); rels.add("<p>"+rel.nicename);
} }
ret += TextUtil.implode(rels, "<n> ,"); ret += TextUtil.implode(rels, "<c> + ");
if (withDesc) if (withDesc)
{ {
ret += " " + this.getDescription(); ret += " <i>" + this.getDescription();
} }
return ret; return ret;
} }