SHARE
TWEET

Untitled

a guest Apr 21st, 2017 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Abilities:
  2.     class A001: pass
  3.     class A002: pass
  4.  
  5. class Unit:
  6.     statAbilities = ["A001", "A002"]
  7.  
  8.     def castAbility(self, abilityID, data):
  9.         for ability in self.statAbilities:
  10.             if ability == abilityID:
  11.                 targetAbility = getattr(Abilities, abilityID)
  12.                 instance = targetAbility(data)
  13.  
  14. testUnit = Unit()
  15. testUnit.castAbility(testAbility.statAbilities[1], data)
RAW Paste Data
Top