package HeroPreset import public UnitObjEditing import LinkedList import ObjectIds import AbilityIds public class HeroPreset extends HeroDefinition constant properNames = new LinkedList() string heroAbilityString = "" string normalAbilityString = AbilityIds.inventory.toRawCode() + "," construct(int newId, int origId, string name) super(newId, origId) setName(name) function buildHero() buildProperNames() buildHeroAbilities() buildNormalAbilities() /** Adds a proper Name to the Hero. Remember to call .buildHero() after you finished your changes */ function addProperName(string name) properNames.add(name) function buildProperNames() string s = "" if properNames.size() > 0 for pn in properNames s += pn + "," s = s.substring(0, s.length()-1) setProperNames(s) function addHeroAbility(int id) heroAbilityString += id.toRawCode() + "," function buildHeroAbilities() if heroAbilityString.length() > 0 setHeroAbilities(heroAbilityString.substring(0,heroAbilityString.length()-1)) function addNormalAbility(int id) normalAbilityString += id.toRawCode() + "," function buildNormalAbilities() if normalAbilityString.length() > 0 setNormalAbilities(normalAbilityString.substring(0,normalAbilityString.length()-1))