space-game-proto/obj/player.py

23 lines
505 B
Python
Raw Normal View History

2021-05-11 14:58:22 -04:00
from obj.inventory import Inventory
2021-05-11 10:34:56 -04:00
class Player:
def __init__(self, name, location):
self.name = name
self.location = location
2021-05-11 14:58:22 -04:00
self.inventory = Inventory()
2021-05-11 10:34:56 -04:00
def getName(self):
return self.name
def setName(self, name):
self.name = name
def getLocation(self):
return self.location
2021-05-11 14:58:22 -04:00
def addItem(self, item, quantity):
self.inventory.addItem(item, quantity)
def printInventory(self):
self.inventory.printInventory()