space-game-proto/obj/inventorySlot.py

21 lines
439 B
Python
Raw Normal View History

2021-05-11 14:58:22 -04:00
class InventorySlot:
'One item plus quantity'
#Do I want to add the value here too?
def __init__(self, item, quantity):
self.item = item
self.quantity = quantity
def incItem(self, amount):
self.quantity += amount
def decItem(self, amount):
self.quantity -=amount
def getQuantity(self):
return self.quantity
def getName(self):
return self.item.getName()