From d2a58a03925b5ddbc1b2c5da78be6ad73cd12632 Mon Sep 17 00:00:00 2001 From: Alexandre CATTEAU Date: Mon, 6 May 2024 10:07:22 +0200 Subject: [PATCH] Update method names to better match what they do --- data-generator.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/data-generator.py b/data-generator.py index a3ae6d5..07deb44 100644 --- a/data-generator.py +++ b/data-generator.py @@ -33,7 +33,7 @@ class Circus: def getNextColor(self): return self.wagons[self.state - 1] - def getWagon(self): + def takeWagon(self): if self.state == 0: print("Circus is not or no longer in game.") return False @@ -63,15 +63,15 @@ class ConcessionCard: # name may be different in English def getRemainingPepites(self): return {1, 2, 3, 4, 5, 6, 7} - self.taken - def getReward(self, choice): + def takeReward(self, choice): if choice in self.taken: print(str(choice) + " has already been obtained.") return False self.taken.add(choice) print("Congrats! You obtained $" + str(self.pepites[choice])) - return True class Player: + def __init__(self, color): self.color = color self.concession = ConcessionCard() @@ -140,11 +140,11 @@ playersNb = 2 # cc = ConcessionCard() # userChoice = 3 # print(cc.pepites) -# cc.getReward(userChoice - 1) +# cc.takeReward(userChoice - 1) # print(cc.pepites) # print(cc.taken) # print("Remaining: " + str(cc.getRemainingPepites())) -# cc.getReward(userChoice - 1) +# cc.takeReward(userChoice - 1) # print(cc.pepites) # print(cc.taken) # print("Remaining: " + str(cc.getRemainingPepites())) @@ -153,8 +153,6 @@ playersNb = 2 myGame = Game() myGame.initGame(playersNb) myGame.printStatus() -myGame.concession = True -myGame.printStatus() myGame.circus.enable() myGame.printStatus() print(myGame.circus.wagons)