2014-07-16 20:07:23 +02:00
|
|
|
package com.gmail.nossr50.api;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.List;
|
|
|
|
|
2018-12-29 14:24:55 +01:00
|
|
|
import com.gmail.nossr50.datatypes.skills.PrimarySkill;
|
2014-07-16 20:07:23 +02:00
|
|
|
|
|
|
|
public final class SkillAPI {
|
|
|
|
private SkillAPI() {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a list of strings with mcMMO's skills
|
|
|
|
* This includes parent and child skills
|
|
|
|
* </br>
|
|
|
|
* This function is designed for API usage.
|
|
|
|
*
|
|
|
|
* @return a list of strings with valid skill names
|
|
|
|
*/
|
|
|
|
public static List<String> getSkills() {
|
2018-12-29 14:24:55 +01:00
|
|
|
return getListFromEnum(Arrays.asList(PrimarySkill.values()));
|
2014-07-16 20:07:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a list of strings with mcMMO's skills
|
|
|
|
* This only includes parent skills
|
|
|
|
* </br>
|
|
|
|
* This function is designed for API usage.
|
|
|
|
*
|
|
|
|
* @return a list of strings with valid skill names
|
|
|
|
*/
|
|
|
|
public static List<String> getNonChildSkills() {
|
2018-12-29 14:24:55 +01:00
|
|
|
return getListFromEnum(PrimarySkill.NON_CHILD_SKILLS);
|
2014-07-16 20:07:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a list of strings with mcMMO's skills
|
|
|
|
* This only includes child skills
|
|
|
|
* </br>
|
|
|
|
* This function is designed for API usage.
|
|
|
|
*
|
|
|
|
* @return a list of strings with valid skill names
|
|
|
|
*/
|
|
|
|
public static List<String> getChildSkills() {
|
2018-12-29 14:24:55 +01:00
|
|
|
return getListFromEnum(PrimarySkill.CHILD_SKILLS);
|
2014-07-16 20:07:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a list of strings with mcMMO's skills
|
|
|
|
* This only includes combat skills
|
|
|
|
* </br>
|
|
|
|
* This function is designed for API usage.
|
|
|
|
*
|
|
|
|
* @return a list of strings with valid skill names
|
|
|
|
*/
|
|
|
|
public static List<String> getCombatSkills() {
|
2018-12-29 14:24:55 +01:00
|
|
|
return getListFromEnum(PrimarySkill.COMBAT_SKILLS);
|
2014-07-16 20:07:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a list of strings with mcMMO's skills
|
|
|
|
* This only includes gathering skills
|
|
|
|
* </br>
|
|
|
|
* This function is designed for API usage.
|
|
|
|
*
|
|
|
|
* @return a list of strings with valid skill names
|
|
|
|
*/
|
|
|
|
public static List<String> getGatheringSkills() {
|
2018-12-29 14:24:55 +01:00
|
|
|
return getListFromEnum(PrimarySkill.GATHERING_SKILLS);
|
2014-07-16 20:07:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a list of strings with mcMMO's skills
|
|
|
|
* This only includes misc skills
|
|
|
|
* </br>
|
|
|
|
* This function is designed for API usage.
|
|
|
|
*
|
|
|
|
* @return a list of strings with valid skill names
|
|
|
|
*/
|
|
|
|
public static List<String> getMiscSkills() {
|
2018-12-29 14:24:55 +01:00
|
|
|
return getListFromEnum(PrimarySkill.MISC_SKILLS);
|
2014-07-16 20:07:23 +02:00
|
|
|
}
|
|
|
|
|
2018-12-29 14:24:55 +01:00
|
|
|
private static List<String> getListFromEnum(List<PrimarySkill> skillsTypes) {
|
2014-07-16 20:07:23 +02:00
|
|
|
List<String> skills = new ArrayList<String>();
|
|
|
|
|
2018-12-29 14:24:55 +01:00
|
|
|
for (PrimarySkill primarySkill : skillsTypes) {
|
|
|
|
skills.add(primarySkill.name());
|
2014-07-16 20:07:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return skills;
|
|
|
|
}
|
|
|
|
}
|