forked from Team-Teamwork-CS/CS-Build-Week-1-Flask
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathitems.py
More file actions
22 lines (19 loc) · 747 Bytes
/
items.py
File metadata and controls
22 lines (19 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
class Item:
def __init__(self, name, description, price):
self.name = name
self.description = description
self.price = price
# def __str__(self):
# display_string = f"{self.name}, "
# display_string += f"{self.description}"
# return display_string
class Food(Item):
def __init__(self, name, description, price, food_type, healing_amount=0):
super().__init__(name, description, price)
self.food_type = food_type
self.healing_amount = healing_amount
class Weapon(Item):
def __init__(self, name, description, price, weapon_type, damage=0):
super().__init__(name, description, price)
self.weapon_type = weapon_type
self.damage = damage