package com.gmail.nossr50.api; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import com.gmail.nossr50.datatypes.skills.PrimarySkill; public final class SkillAPI { private SkillAPI() {} /** * Returns a list of strings with mcMMO's skills * This includes parent and child skills *
* This function is designed for API usage. * * @return a list of strings with valid skill names */ public static List getSkills() { return getListFromEnum(Arrays.asList(PrimarySkill.values())); } /** * Returns a list of strings with mcMMO's skills * This only includes parent skills *
* This function is designed for API usage. * * @return a list of strings with valid skill names */ public static List getNonChildSkills() { return getListFromEnum(PrimarySkill.NON_CHILD_SKILLS); } /** * Returns a list of strings with mcMMO's skills * This only includes child skills *
* This function is designed for API usage. * * @return a list of strings with valid skill names */ public static List getChildSkills() { return getListFromEnum(PrimarySkill.CHILD_SKILLS); } /** * Returns a list of strings with mcMMO's skills * This only includes combat skills *
* This function is designed for API usage. * * @return a list of strings with valid skill names */ public static List getCombatSkills() { return getListFromEnum(PrimarySkill.COMBAT_SKILLS); } /** * Returns a list of strings with mcMMO's skills * This only includes gathering skills *
* This function is designed for API usage. * * @return a list of strings with valid skill names */ public static List getGatheringSkills() { return getListFromEnum(PrimarySkill.GATHERING_SKILLS); } /** * Returns a list of strings with mcMMO's skills * This only includes misc skills *
* This function is designed for API usage. * * @return a list of strings with valid skill names */ public static List getMiscSkills() { return getListFromEnum(PrimarySkill.MISC_SKILLS); } private static List getListFromEnum(List skillsTypes) { List skills = new ArrayList(); for (PrimarySkill primarySkill : skillsTypes) { skills.add(primarySkill.name()); } return skills; } }