コード例 #1
0
 def _get_consumable(name) -> CustomCounter:
     consumable = next(
         (con for con in character.consumables if con.name == name),
         None)
     if consumable is None:
         raise ConsumableException(f"There is no counter named {name}.")
     return consumable
コード例 #2
0
ファイル: character.py プロジェクト: avrae/avrae
 def _get_consumable(self, name):
     name = str(name)
     consumable = self._character.get_consumable(name)
     if consumable is None:
         raise ConsumableException(f"There is no counter named {name}.")
     return consumable
コード例 #3
0
 def _get_consumable(self, name):
     consumable = next((con for con in self._character.consumables if con.name == name), None)
     if consumable is None:
         raise ConsumableException(f"There is no counter named {name}.")
     return consumable