def dataSetUp(self): # Data setup self.player_names = ["*Annie", "Ben", "*Carla"] self.nV = testUtility.GetNumVictory(self.player_names) self.nC = testUtility.GetNumCurses(self.player_names) self.box = testUtility.GetBoxes(self.nV) self.supply_order = testUtility.GetSupplyOrder() #Setup supply with 5 cards self.supply = testUtility.GetSupply(self.box, self.nV, self.nC, len(self.player_names), 5) self.trash = [] #set player self.player = Dominion.Player(self.player_names[1]) #Ben
def setUp(self): #setup empty trash pile self.trash = [] #setup players self.players = testUtility.GetPlayerNames() #setup victory cards self.nV = testUtility.GetNumVictoryCards(self.players) #setup curse cards self.nC = testUtility.GetNumCursesCards(self.players) #create the box of cards self.box = testUtility.GetBoxes(self.nV) #get the supply order self.supply_order = testUtility.GetSupplyOrder() # Pick n cards from box to be in the supply self.supply = testUtility.pick10CardsToBeInSupply(self.box) #update supply with all the victory and curse guards based #on the players testUtility.updateSupply(self.supply, self.players, self.nV, self.nC) #make current player annnie self.player = Dominion.Player("Annie")
import random from collections import defaultdict import testUtility # Get player names player_names = testUtility.GetPlayerNames() # number of curses and victory cards nV = testUtility.GetNV(player_names) nC = -10 + 10 * len(player_names) # get box box = testUtility.GetBoxes(nV) # get supply order supply_order = testUtility.GetSupplyOrder() # Pick 10 cards from box to be in the supply. boxlist = [k for k in box] random.shuffle(boxlist) # game will only have one card from box to be in the supply random10 = boxlist[:1] supply = defaultdict(list, [(k, box[k]) for k in random10]) # Get supply supply = testUtility.SupplyAlwaysHas(supply, player_names, nV, nC) # initialize the trash trash = []