def setUp(self):
        # Get player names
        # player_names = ["Annie","*Ben","*Carla"]
        self.player_names = testUtility.GetPlayers()

        # number of curses and victory cards
        if len(self.player_names) > 2:
            self.nV = 12
        else:
            self.nV = 8
        self.nC = -10 + 10 * len(self.player_names)
        # Refactored Get boxs
        self.box = testUtility.GetBoxes(self.nV)
        # refactored supplu order
        self.supply_order = testUtility.SupplyOrder()

        # Pick 10 cards from box to be in the supply.

        self.supply = defaultdict(list)

        # The supply always has these cards
        self.supply["Copper"] = [Dominion.Copper()]
        self.supply["Silver"] = [Dominion.Silver()]
        self.supply["Gold"] = [Dominion.Gold()]
        self.supply["Estate"] = [Dominion.Estate()]
        self.supply["Duchy"] = [Dominion.Duchy()]
        self.supply["Province"] = [Dominion.Province()]
        self.supply["Curse"] = [Dominion.Curse()]

        # initialize the trash
        self.trash = []

        self.player = Dominion.Player('Annie')
Beispiel #2
0
    def setUp(self):
        # Get player names
        self.player_names = ["*Ryan", "*Janie"]

        # number of curses and victory cards
        if len(self.player_names) > 2:
            self.nV = 12
        else:
            self.nV = 8
        self.nC = -10 + 10 * len(self.player_names)

        self.box = testUtility.GetBoxes(self.nV)

        # Pick 10 cards from box to be in the supply.
        self.supply = testUtility.pickCards(self.box, self.player_names,
                                            self.nV, self.nC)

        # initialize the trash
        self.trash = []

        # Costruct the Player objects
        self.players = testUtility.makePlayers(self.player_names)

        # Final score
        testUtility.finalScore([Dominion.Player(self.players)])
 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
Beispiel #4
0
 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")
    def setUp(self):

        self.player_names = testUtility.GetPlayers()

        # number of curses and victory cards
        if len(self.player_names) > 2:
            self.nV = 12
        else:
            self.nV = 8
        self.nC = -10 + 10 * len(self.player_names)
        # Refactored Get boxs
        self.box = testUtility.GetBoxes(self.nV)
        # refactored supplu order
        self.supply_order = testUtility.SupplyOrder()

        # Pick 10 cards from box to be in the supply.
        self.boxlist = [k for k in self.box]
        random.shuffle(self.boxlist)
        self.random10 = self.boxlist[:10]
        self.supply = defaultdict(list,
                                  [(k, self.box[k]) for k in self.random10])

        # The supply always has these cards
        self.supply["Copper"] = [Dominion.Copper()
                                 ] * (60 - len(self.player_names) * 7)
        self.supply["Silver"] = [Dominion.Silver()] * 40
        self.supply["Gold"] = [Dominion.Gold()] * 30
        self.supply["Estate"] = [Dominion.Estate()] * self.nV
        self.supply["Duchy"] = [Dominion.Duchy()] * self.nV
        self.supply["Province"] = [Dominion.Province()] * self.nV
        self.supply["Curse"] = [Dominion.Curse()] * self.nC

        # initialize the trash
        self.trash = []
        self.name = "Blueberry"
        self.actions = 3
        self.coins = 10

        self.player = Dominion.Player('Annie')
        self.player2 = Dominion.Player('Carla')
Beispiel #6
0
import Dominion
import random
import testUtility
from collections import defaultdict

#Get player names
player_names = ["*Ryan"]

#number of curses and victory cards
if len(player_names) > 2:
    nV = 12
else:
    nV = 8
nC = -10 + 10 * len(player_names)

box = testUtility.GetBoxes(nV)

#Pick 10 cards from box to be in the supply.
supply = testUtility.pickCards(box, player_names, nV, nC)

#initialize the trash
trash = []

#Costruct the Player objects
players = testUtility.makePlayers(player_names)

#Play the game
testUtility.playGame(supply, players, trash)

#Final score
testUtility.finalScore(players)
Beispiel #7
0
@author: Wes Bakane
"""
import Dominion
import testUtility
from collections import defaultdict

#Get player names
player_names = []

#Calculate number of victory and curse cards
nV = testUtility.NumVictoryCards(len(player_names))
nC = testUtility.NumCurseCards(len(player_names))

#Initialize boxes
box = testUtility.GetBoxes(len(player_names))

supply_order = {
    0: ['Curse', 'Copper'],
    2: ['Estate', 'Cellar', 'Chapel', 'Moat'],
    3: ['Silver', 'Chancellor', 'Village', 'Woodcutter', 'Workshop'],
    4: [
        'Gardens', 'Bureaucrat', 'Feast', 'Militia', 'Moneylender', 'Remodel',
        'Smithy', 'Spy', 'Thief', 'Throne Room'
    ],
    5: [
        'Duchy', 'Market', 'Council Room', 'Festival', 'Laboratory', 'Library',
        'Mine', 'Witch'
    ],
    6: ['Gold', 'Adventurer'],
    8: ['Province']