Last active
August 29, 2015 14:14
-
-
Save spheenik/caa02067dd12e25d7bd4 to your computer and use it in GitHub Desktop.
get abilities and corresponding heros
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Iterator<Entity> iter = match.getEntities().getAllByPredicate(new Predicate<Entity>() { | |
@Override | |
public boolean apply(Entity e) { | |
return e.getDtClass().instanceOf("DT_DOTABaseAbility"); | |
} | |
}); | |
while (iter.hasNext()) { | |
Entity ability = iter.next(); | |
Integer ownerHandle = ability.getProperty("m_hOwnerEntity"); | |
Entity hero = match.getEntities().getByHandle(ownerHandle); | |
// do something with the ability and the hero. | |
Integer abilityLevel = ability.getProperty("m_iLevel"); | |
Integer manaCost = ability.getProperty("m_iManaCost"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment