Moving over to the use of describeTo.

This commit is contained in:
Olof Larsson
2011-10-21 19:20:33 +02:00
parent 51161bbb55
commit 46f5849f9f
26 changed files with 55 additions and 84 deletions

View File

@@ -103,10 +103,6 @@ public class Factions extends EntityCollection<Faction>
}
//----------------------------------------------//
// Faction tag
//----------------------------------------------//
@@ -117,19 +113,19 @@ public class Factions extends EntityCollection<Faction>
if(MiscUtil.getComparisonString(str).length() < Conf.factionTagLengthMin)
{
errors.add(P.p.txt.parse("<i>The faction tag can't be shorter than "+Conf.factionTagLengthMin+ " chars."));
errors.add(P.p.txt.parse("<i>The faction tag can't be shorter than <h>%s<i> chars.", Conf.factionTagLengthMin));
}
if(str.length() > Conf.factionTagLengthMax)
{
errors.add(P.p.txt.parse("<i>The faction tag can't be longer than "+Conf.factionTagLengthMax+ " chars."));
errors.add(P.p.txt.parse("<i>The faction tag can't be longer than <h>%s<i> chars.", Conf.factionTagLengthMax));
}
for (char c : str.toCharArray())
{
if ( ! MiscUtil.substanceChars.contains(String.valueOf(c)))
{
errors.add(P.p.txt.parse("<i>Faction tag must be alphanumeric. \""+c+"\" is not allowed."));
errors.add(P.p.txt.parse("<i>Faction tag must be alphanumeric. \"<h>%s<i>\" is not allowed.", c));
}
}