Update method names to better match what they do
This commit is contained in:
parent
1e3b96e689
commit
d2a58a0392
@ -33,7 +33,7 @@ class Circus:
|
|||||||
def getNextColor(self):
|
def getNextColor(self):
|
||||||
return self.wagons[self.state - 1]
|
return self.wagons[self.state - 1]
|
||||||
|
|
||||||
def getWagon(self):
|
def takeWagon(self):
|
||||||
if self.state == 0:
|
if self.state == 0:
|
||||||
print("Circus is not or no longer in game.")
|
print("Circus is not or no longer in game.")
|
||||||
return False
|
return False
|
||||||
@ -63,15 +63,15 @@ class ConcessionCard: # name may be different in English
|
|||||||
def getRemainingPepites(self):
|
def getRemainingPepites(self):
|
||||||
return {1, 2, 3, 4, 5, 6, 7} - self.taken
|
return {1, 2, 3, 4, 5, 6, 7} - self.taken
|
||||||
|
|
||||||
def getReward(self, choice):
|
def takeReward(self, choice):
|
||||||
if choice in self.taken:
|
if choice in self.taken:
|
||||||
print(str(choice) + " has already been obtained.")
|
print(str(choice) + " has already been obtained.")
|
||||||
return False
|
return False
|
||||||
self.taken.add(choice)
|
self.taken.add(choice)
|
||||||
print("Congrats! You obtained $" + str(self.pepites[choice]))
|
print("Congrats! You obtained $" + str(self.pepites[choice]))
|
||||||
return True
|
|
||||||
|
|
||||||
class Player:
|
class Player:
|
||||||
|
|
||||||
def __init__(self, color):
|
def __init__(self, color):
|
||||||
self.color = color
|
self.color = color
|
||||||
self.concession = ConcessionCard()
|
self.concession = ConcessionCard()
|
||||||
@ -140,11 +140,11 @@ playersNb = 2
|
|||||||
# cc = ConcessionCard()
|
# cc = ConcessionCard()
|
||||||
# userChoice = 3
|
# userChoice = 3
|
||||||
# print(cc.pepites)
|
# print(cc.pepites)
|
||||||
# cc.getReward(userChoice - 1)
|
# cc.takeReward(userChoice - 1)
|
||||||
# print(cc.pepites)
|
# print(cc.pepites)
|
||||||
# print(cc.taken)
|
# print(cc.taken)
|
||||||
# print("Remaining: " + str(cc.getRemainingPepites()))
|
# print("Remaining: " + str(cc.getRemainingPepites()))
|
||||||
# cc.getReward(userChoice - 1)
|
# cc.takeReward(userChoice - 1)
|
||||||
# print(cc.pepites)
|
# print(cc.pepites)
|
||||||
# print(cc.taken)
|
# print(cc.taken)
|
||||||
# print("Remaining: " + str(cc.getRemainingPepites()))
|
# print("Remaining: " + str(cc.getRemainingPepites()))
|
||||||
@ -153,8 +153,6 @@ playersNb = 2
|
|||||||
myGame = Game()
|
myGame = Game()
|
||||||
myGame.initGame(playersNb)
|
myGame.initGame(playersNb)
|
||||||
myGame.printStatus()
|
myGame.printStatus()
|
||||||
myGame.concession = True
|
|
||||||
myGame.printStatus()
|
|
||||||
myGame.circus.enable()
|
myGame.circus.enable()
|
||||||
myGame.printStatus()
|
myGame.printStatus()
|
||||||
print(myGame.circus.wagons)
|
print(myGame.circus.wagons)
|
||||||
|
Loading…
Reference in New Issue
Block a user