我的课程是:
class Champion:
def __init__(self, secondary_bar, secondary_attributes, health, health_reg, mana, mana_reg, c_range, att_damage, att_speed, armor, magic_res, move_speed):
self.secondary_bar = secondary_bar
self.secondary_attributes = secondary_attributes
self.health = health
self.health_reg = health_reg
self.mana = mana
self.mana_reg = mana_reg
self.c_range = c_range
self.att_damage = att_damage
self.att_speed = att_speed
self.armor = armor
self.magic_res = magic_res
self.move_speed = move_speed
...
class SpecificChampion(Champion):
...
my_champ = SpecificChampion("mana", "melee", 500, 20, 250, 20, 125, 50, 0.8, 65, 65, 320)
我想要一种更短的方式来创建第一堂课,因为在我看来它需要太多的空间。我尝试使用kwargs
将它们存储在列表中,但是访问它们并将它们作为参数传递给其他函数有点令人困惑。有什么建议吗?