Search in sources :

Example 1 with HeroClass

use of com.herocraftonline.heroes.characters.classes.HeroClass in project MagicPlugin by elBukkit.

the class HeroesManager method getSkillList.

public List<String> getSkillList(Player player, boolean showUnuseable, boolean showPassive) {
    if (skills == null)
        return emptySkillList;
    Hero hero = getHero(player);
    if (hero == null)
        return emptySkillList;
    HeroClass heroClass = hero.getHeroClass();
    HeroClass secondClass = hero.getSecondClass();
    Set<String> primarySkills = new HashSet<>();
    Set<String> secondarySkills = new HashSet<>();
    addSkills(hero, heroClass, primarySkills, showUnuseable, showPassive);
    addSkills(hero, secondClass, secondarySkills, showUnuseable, showPassive);
    secondarySkills.removeAll(primarySkills);
    Multimap<Integer, Skill> primaryMap = mapSkillsByLevel(hero, primarySkills);
    Multimap<Integer, Skill> secondaryMap = mapSkillsByLevel(hero, secondarySkills);
    List<String> skillNames = new ArrayList<>();
    for (Skill skill : primaryMap.values()) {
        skillNames.add(skill.getName());
    }
    for (Skill skill : secondaryMap.values()) {
        skillNames.add(skill.getName());
    }
    return skillNames;
}
Also used : Skill(com.herocraftonline.heroes.characters.skill.Skill) ActiveSkill(com.herocraftonline.heroes.characters.skill.ActiveSkill) HeroClass(com.herocraftonline.heroes.characters.classes.HeroClass) Hero(com.herocraftonline.heroes.characters.Hero) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet)

Example 2 with HeroClass

use of com.herocraftonline.heroes.characters.classes.HeroClass in project MagicPlugin by elBukkit.

the class HeroesManager method getSecondaryClassName.

public String getSecondaryClassName(Player player) {
    Hero hero = getHero(player);
    if (hero == null)
        return "";
    HeroClass heroClass = hero.getSecondClass();
    if (heroClass == null)
        return "";
    return heroClass.getName();
}
Also used : HeroClass(com.herocraftonline.heroes.characters.classes.HeroClass) Hero(com.herocraftonline.heroes.characters.Hero)

Example 3 with HeroClass

use of com.herocraftonline.heroes.characters.classes.HeroClass in project MagicPlugin by elBukkit.

the class HeroesManager method getSkills.

public Set<String> getSkills(Player player, boolean showUnuseable, boolean showPassive) {
    if (skills == null)
        return emptySkills;
    Hero hero = getHero(player);
    if (hero == null)
        return emptySkills;
    Set<String> skillSet = new HashSet<>();
    HeroClass heroClass = hero.getHeroClass();
    HeroClass secondClass = hero.getSecondClass();
    addSkills(hero, heroClass, skillSet, showUnuseable, showPassive);
    addSkills(hero, secondClass, skillSet, showUnuseable, showPassive);
    return skillSet;
}
Also used : HeroClass(com.herocraftonline.heroes.characters.classes.HeroClass) Hero(com.herocraftonline.heroes.characters.Hero) HashSet(java.util.HashSet)

Example 4 with HeroClass

use of com.herocraftonline.heroes.characters.classes.HeroClass in project MagicPlugin by elBukkit.

the class HeroesManager method getClassName.

public String getClassName(Player player) {
    Hero hero = getHero(player);
    if (hero == null)
        return "";
    HeroClass heroClass = hero.getHeroClass();
    if (heroClass == null)
        return "";
    return heroClass.getName();
}
Also used : HeroClass(com.herocraftonline.heroes.characters.classes.HeroClass) Hero(com.herocraftonline.heroes.characters.Hero)

Aggregations

Hero (com.herocraftonline.heroes.characters.Hero)4 HeroClass (com.herocraftonline.heroes.characters.classes.HeroClass)4 HashSet (java.util.HashSet)2 ActiveSkill (com.herocraftonline.heroes.characters.skill.ActiveSkill)1 Skill (com.herocraftonline.heroes.characters.skill.Skill)1 ArrayList (java.util.ArrayList)1