We don't need two functions that do the exact same thing.

This commit is contained in:
GJ
2013-02-07 12:17:18 -05:00
parent c3f83302c5
commit 6c266a8926
7 changed files with 15 additions and 31 deletions

View File

@ -269,22 +269,6 @@ public class SkillTools {
}
}
/**
* Get the skill represented by the given string
*
* @param skillName The name of the skill
* @return the SkillType if it exists, null otherwise
*/
public static SkillType getSkillType(String skillName) {
for (SkillType x : SkillType.values()) {
if (x.toString().equalsIgnoreCase(skillName)) {
return x;
}
}
return null;
}
/**
* Checks if the given string represents a valid skill
*
@ -292,7 +276,7 @@ public class SkillTools {
* @return true if this is a valid skill, false otherwise
*/
public static boolean isSkill(String skillName) {
if (getSkillType(skillName) != null) {
if (SkillType.getSkill(skillName) != null) {
return true;
}

View File

@ -119,7 +119,7 @@ public enum SkillType {
}
public static SkillType getSkill(String skillName) {
for (SkillType type : SkillType.values()) {
for (SkillType type : values()) {
if (type.name().equalsIgnoreCase(skillName)) {
return type;
}