Ejemplo n.º 1
0
 def on_item_selected(self, item: Item) -> Optional[ActionOrHandler]:
     if item.consumable:
         return item.consumable.get_action(self.engine.player)
     elif item.equippable:
         return actions.EquipAction(self.engine.player, item)
     else:
         return None
Ejemplo n.º 2
0
 def on_item_selected(self, item: Item) -> Optional[Action]:
     if item.consumable:
         # Return the action for the selected item.
         return item.consumable.get_action(self.engine.player)
     elif item.equippable:
         return actions.EquipAction(self.engine.player, item)
     else:
         return None
 def on_item_selected(self, item: Item) -> Optional[ActionOrHandler]:
     """Called when the user selects a valid item."""
     if item.consumable:
         # Return the action for the selected item
         return item.consumable.get_action(self.engine.player)
     elif item.equippable:
         return actions.EquipAction(self.engine.player, item)
     else:
         return None