Item & Inventory
This commit is contained in:
10
item.py
10
item.py
@@ -1,5 +1,11 @@
|
||||
from .serializable import Serializable
|
||||
|
||||
class Item(Serializable):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
def __init__(self,name:str, description:str, weight:float = 10.0):
|
||||
super().__init__()
|
||||
self.name = name
|
||||
self.description = description
|
||||
self.weight = weight
|
||||
|
||||
def __str__(self):
|
||||
return self.name + '(' + self.weight + ' kg)' + ': ' + self.description
|
||||
Reference in New Issue
Block a user