space-game-proto/obj/gameManager.py
2021-05-11 14:58:22 -04:00

53 lines
1.3 KiB
Python

from .player import Player
import tools
PLAYER_INIT_LOCATION = "Luna"
class GameManager:
'Manage the game'
def __init__(self, userInput, planets):
self.gameIsRunning = True
self.player = Player(userInput, PLAYER_INIT_LOCATION)
self.planets = planets
def isGameRunning(self):
return self.gameIsRunning
def stopGame(self):
self.gameIsRunning = False
def printPlayerStats(self):
tools.clearScreen()
print("Name: ", self.player.getName())
print("Location: ", self.player.getLocation())
self.player.printInventory()
print()
def buyMenu(self):
print()
#list items
#assign each item a number
#choose number
#ask for quantity
#Confirm
#add item with quantity to player inv
def enterTradeHub(self):
tools.clearScreen()
while True:
userInput = input("(e)xit\n\n(l)ist items\n(b)uy\n>> ").lower()
if userInput == 'e':
tools.clearScreen()
break;
elif userInput == 'l':
tools.clearScreen()
self.planets[self.player.getLocation()].getTradeHub().printItems()
elif userInput == 'b':
self.buyMenu()
else:
tools.clearScreen()