getMagicAffinity() and setMagicAffinity() methods (auto-generated via annotations)
When initializing hero class stats, magic affinity is set from JSON: hero.getHeroClass().setMagicAffinity(classDesc.optString(“magicAffinity”, magicAffinity))
In SpellHelper.java:
affinityToIcon map includes: affinityToIcon.put(“Elf”, 19); (maps Elf affinity to icon id 19)
iconIdByAffinity() method returns icon ID based on hero's magic affinity
Affinity System Mechanics
Magic affinities determine which spells are displayed with appropriate icons in spell selection
Each hero class can have a default magic affinity
Spell classes define their magic affinity which determines which hero classes they're accessible to
The spell system checks hero.getHeroClass().getMagicAffinity() to determine which spells to show