public void UseYearOfPlentyCard_UseCardPurchasedInSameTurn_MeaningfulErrorIsReceived()
        {
            // Arrange
            var yearOfPlentyCard    = new YearOfPlentyDevelopmentCard();
            var testInstances       = this.TestSetupWithExplictDevelopmentCards(yearOfPlentyCard);
            var localGameController = testInstances.LocalGameController;

            testInstances.MainPlayer.AddResources(ResourceClutch.DevelopmentCard);

            GameToken turnToken = null;

            localGameController.StartPlayerTurnEvent = (GameToken t) => { turnToken = t; };

            DevelopmentCard purchasedDevelopmentCard = null;

            localGameController.DevelopmentCardPurchasedEvent = (DevelopmentCard d) => { purchasedDevelopmentCard = d; };

            localGameController.StartGamePlay();
            localGameController.BuyDevelopmentCard(turnToken);

            ErrorDetails errorDetails = null;

            localGameController.ErrorRaisedEvent = (ErrorDetails e) => { errorDetails = e; };

            // Act
            localGameController.UseYearOfPlentyCard(turnToken, (YearOfPlentyDevelopmentCard)purchasedDevelopmentCard, ResourceTypes.Brick, ResourceTypes.Brick);

            // Assert
            errorDetails.ShouldNotBeNull();
            errorDetails.Message.ShouldBe("Cannot use development card that has been purchased this turn.");
        }
Exemplo n.º 2
0
        public void UseKnightCard_UseKnightDevelopmentCardAndTryToMoveRobberToSameSpot_MeaningfulErrorIsReceived()
        {
            // Arrange
            var knightCard          = new KnightDevelopmentCard();
            var testInstances       = this.TestSetup(knightCard);
            var localGameController = testInstances.LocalGameController;

            testInstances.Dice.AddSequenceWithRepeatingRoll(null, 6);
            testInstances.MainPlayer.AddResources(ResourceClutch.DevelopmentCard);

            GameToken turnToken = null;

            localGameController.StartPlayerTurnEvent = (GameToken t) => { turnToken = t; };

            DevelopmentCard purchasedDevelopmentCard = null;

            localGameController.DevelopmentCardPurchasedEvent = (DevelopmentCard d) => { purchasedDevelopmentCard = d; };

            localGameController.StartGamePlay();
            localGameController.BuyDevelopmentCard(turnToken);
            localGameController.EndTurn(turnToken);

            ErrorDetails errorDetails = null;

            localGameController.ErrorRaisedEvent = (ErrorDetails e) => { errorDetails = e; };

            // Act
            localGameController.UseKnightCard(turnToken, (KnightDevelopmentCard)purchasedDevelopmentCard, 0);

            // Assert
            errorDetails.ShouldNotBeNull();
            errorDetails.Message.ShouldBe("Cannot place robber back on present hex (0).");
        }
Exemplo n.º 3
0
    public bool CanBuyCard(DevelopmentCard card)
    {
        if (!FulfillsRequirements(card.Requirements))
        {
            return(false);
        }

        Dictionary <EnumColour, int> costs = CostToPay(card);

        foreach (EnumColour col in costs.Keys)
        {
            costs[col] -= Tokens[col];
            if (costs[col] < 0)
            {
                costs[col] = 0;
            }
        }
        int goldRequired = 0;

        foreach (EnumColour col in costs.Keys)
        {
            goldRequired += costs[col];
        }

        return(Tokens.ContainsKey(EnumColour.GOLD) && goldRequired <= Tokens[EnumColour.GOLD]);
    }
Exemplo n.º 4
0
        public void BuyDevelopmentCard_GotResources_DevelopmentCardPurchasedEventIsRaised()
        {
            // Arrange
            var knightDevelopmentCard = new KnightDevelopmentCard();
            var testInstances         = this.TestSetup(this.CreateMockOneCardDevelopmentCardHolder(knightDevelopmentCard));

            testInstances.MainPlayer.AddResources(ResourceClutch.DevelopmentCard);
            var localGameController = testInstances.LocalGameController;

            GameToken turnToken = null;

            localGameController.StartPlayerTurnEvent = (GameToken t) => { turnToken = t; };

            ErrorDetails errorDetails = null;

            localGameController.ErrorRaisedEvent = (ErrorDetails e) => { errorDetails = e; };

            DevelopmentCard purchaseddDevelopmentCard = null;

            localGameController.DevelopmentCardPurchasedEvent = (DevelopmentCard d) => { purchaseddDevelopmentCard = d; };

            localGameController.StartGamePlay();

            // Act
            localGameController.BuyDevelopmentCard(turnToken);

            // Assert
            purchaseddDevelopmentCard.ShouldNotBeNull();
            purchaseddDevelopmentCard.ShouldBeSameAs(knightDevelopmentCard);
            errorDetails.ShouldBeNull();
        }
        private IDevelopmentCardHolder CreateMockCardDevelopmentCardHolder(DevelopmentCard firstDevelopmentCard, params DevelopmentCard[] otherDevelopmentCards)
        {
            var developmentCardHolder = Substitute.For <IDevelopmentCardHolder>();
            var developmentCards      = new Queue <DevelopmentCard>();

            developmentCards.Enqueue(firstDevelopmentCard);
            foreach (var developmentCard in otherDevelopmentCards)
            {
                developmentCards.Enqueue(developmentCard);
            }

            DevelopmentCard card;

            developmentCardHolder
            .TryGetNextCard(out card)
            .Returns(x =>
            {
                if (developmentCards.Count > 0)
                {
                    x[0] = developmentCards.Dequeue();
                    return(true);
                }

                x[0] = null;
                return(false);
            });

            developmentCardHolder.HasCards.Returns(x => { return(developmentCards.Count > 0); });
            return(developmentCardHolder);
        }
Exemplo n.º 6
0
        public void UseKnightCard_NewRobberHexIsOutOfBounds_MeaningfulErrorIsReceived()
        {
            // Arrange
            var knightCard          = new KnightDevelopmentCard();
            var testInstances       = this.TestSetup(knightCard);
            var localGameController = testInstances.LocalGameController;

            testInstances.Dice.AddSequence(new uint[] { 8, 8, 8, 8 });
            testInstances.MainPlayer.AddResources(ResourceClutch.DevelopmentCard);

            GameToken turnToken = null;

            localGameController.StartPlayerTurnEvent = (GameToken t) => { turnToken = t; };

            DevelopmentCard purchasedDevelopmentCard = null;

            localGameController.DevelopmentCardPurchasedEvent = (DevelopmentCard d) => { purchasedDevelopmentCard = d; };

            localGameController.StartGamePlay();
            localGameController.BuyDevelopmentCard(turnToken);
            localGameController.EndTurn(turnToken);

            ErrorDetails errorDetails = null;

            localGameController.ErrorRaisedEvent = (ErrorDetails e) => { errorDetails = e; };

            // Act
            localGameController.UseKnightCard(turnToken, (KnightDevelopmentCard)purchasedDevelopmentCard, GameBoards.GameBoard.StandardBoardHexCount);

            // Assert
            errorDetails.ShouldNotBeNull();
            errorDetails.Message.ShouldBe("Cannot move robber to hex 19 because it is out of bounds (0.. 18).");
        }
Exemplo n.º 7
0
        private IDevelopmentCardHolder CreateMockOneCardDevelopmentCardHolder(DevelopmentCard developmentCard)
        {
            DevelopmentCard card;
            var             developmentCardHolder = Substitute.For <IDevelopmentCardHolder>();

            developmentCardHolder
            .TryGetNextCard(out card)
            .Returns(x => { x[0] = developmentCard; return(true); });
            developmentCardHolder.HasCards.Returns(true);
            return(developmentCardHolder);
        }
Exemplo n.º 8
0
        public bool TryGetNextCard(out DevelopmentCard card)
        {
            card = null;
            if (!this.HasCards)
            {
                return(false);
            }

            card = this.developmentCards.Dequeue();
            return(true);
        }
Exemplo n.º 9
0
    public Dictionary <EnumColour, int> CostToPay(DevelopmentCard card)
    {
        Dictionary <EnumColour, int> costToPay = new Dictionary <EnumColour, int>();

        foreach (EnumColour col in card.Costs.Keys)
        {
            costToPay.Add(col, card.Costs[col] - GetBonusAmount(col));
            if (costToPay[col] < 0)
            {
                costToPay[col] = 0;
            }
        }

        return(costToPay);
    }
Exemplo n.º 10
0
    public void BuyDevelopmentCard(DevelopmentCard card)
    {
        if (!CanBuyCard(card))
        {
            return;
        }

        Dictionary <EnumColour, int> costs = CostToPay(card);

        foreach (EnumColour col in costs.Keys)
        {
            while (costs[col] > 0)
            {
                if (Tokens[col] > 0)
                {
                    ReturnToken(col);
                    costs[col]--;
                }
                else if (Tokens[EnumColour.GOLD] > 0)
                {
                    ReturnToken(EnumColour.GOLD);
                    costs[col]--;
                }
                else
                {
                    throw new NotImplementedException("BuyDevelopmentCard(): can't pay cost; CanBuyCard() returned invalid result");
                }
            }
        }

        if (ReservedCards.Contains(card))
        {
            ReservedCards.Remove(card);
        }
        else if (GameBoard.Instance.RevealedDevCards.Contains(card))
        {
            GameBoard.Instance.RevealedDevCards.Remove(card);
            GameBoard.Instance.RevealDevelopmentCards();
        }
        else
        {
            throw new NotImplementedException("BuyDevelopmentCard(): unknown card origin");
        }

        DevelopmentCards.Add(card);
    }
Exemplo n.º 11
0
        public void AddDevelopmentCard(DevelopmentCardTypes developmentCardType)
        {
            DevelopmentCard developmentCard = null;

            switch (developmentCardType)
            {
            case DevelopmentCardTypes.Knight: developmentCard = new KnightDevelopmentCard(); break;

            case DevelopmentCardTypes.Monopoly: developmentCard = new MonopolyDevelopmentCard(); break;

            case DevelopmentCardTypes.RoadBuilding: developmentCard = new RoadBuildingDevelopmentCard(); break;

            case DevelopmentCardTypes.YearOfPlenty: developmentCard = new YearOfPlentyDevelopmentCard(); break;

            default: throw new NotImplementedException($"Development card type {developmentCardType} not recognised");
            }

            this.developmentCards.Enqueue(developmentCard);
        }
Exemplo n.º 12
0
        public override void AddDevelopmentCard(DevelopmentCard developmentCard)
        {
            DevelopmentCardTypes?developmentCardType = null;

            if (developmentCard is KnightDevelopmentCard)
            {
                developmentCardType = DevelopmentCardTypes.Knight;
            }

            if (developmentCard is MonopolyDevelopmentCard)
            {
                developmentCardType = DevelopmentCardTypes.Monopoly;
            }

            if (developmentCard is YearOfPlentyDevelopmentCard)
            {
                developmentCardType = DevelopmentCardTypes.YearOfPlenty;
            }

            if (developmentCardType == null)
            {
                throw new Exception("Development card is not recognised.");
            }

            var key = developmentCardType.Value;

            if (!this.developmentCards.ContainsKey(key))
            {
                var queue = new Queue <DevelopmentCard>();
                queue.Enqueue(developmentCard);
                this.developmentCards.Add(key, queue);
            }
            else
            {
                this.developmentCards[key].Enqueue(developmentCard);
            }
        }
Exemplo n.º 13
0
 public override void AddDevelopmentCard(DevelopmentCard developmentCard)
 {
     base.AddDevelopmentCard(developmentCard);
     this.BoughtDevelopmentCards.Enqueue(developmentCard);
 }
        public override void executeUpdate(Object sender, EventArgs e)
        {
            switch (currentState)
            {
            case State.Wait:
                if (sender == theBoard.btnEndTurn)
                {
                    //End turn.
                    theBoard.addEventText(UserMessages.PlayerEndedTurn(theBoard.currentPlayer));
                    endExecution();
                    return;
                }
                else if (sender is Settlement)
                {
                    Settlement location = (Settlement)sender;
                    try
                    {
                        //Try to build the settlement/upgrade city.
                        ((Settlement)sender).buildSettlement(theBoard.currentPlayer, true, true);
                        //Take resources
                        if (location.city())
                        {
                            //take city resources
                            Board.TheBank.takePayment(theBoard.currentPlayer, Bank.CITY_COST);
                            theBoard.addEventText(UserMessages.PlayerBuiltACity(theBoard.currentPlayer));
                            theBoard.checkForWinner();
                        }
                        else
                        {
                            //take settlement resources
                            Board.TheBank.takePayment(theBoard.currentPlayer, Bank.SETTLEMENT_COST);
                            theBoard.addEventText(UserMessages.PlayerPlacedASettlement(theBoard.currentPlayer));
                            theBoard.checkForWinner();
                        }
                    } catch (BuildError be)
                    {
                        theBoard.addEventText(be.Message);
                    }
                }
                else if (sender is Road)
                {
                    //Try to build the road
                    try
                    {
                        ((Road)sender).buildRoad(theBoard.currentPlayer, true);
                        //Take the resources.
                        Board.TheBank.takePayment(theBoard.currentPlayer, Bank.ROAD_COST);
                        theBoard.addEventText(UserMessages.PlayerPlacedARoad(theBoard.currentPlayer));
                        //RUN LONGEST ROAD CHECK
                        theBoard.checkForWinner();
                    } catch (BuildError be)
                    {
                        theBoard.addEventText(be.Message);
                    }
                }
                else if (sender == theBoard.pbBuildDevelopmentCard)
                {
                    //We want to give the player a development card.
                    try
                    {
                        DevelopmentCard devC = Board.TheBank.purchaseDevelopmentCard(theBoard.currentPlayer);
                        devC.setPlayable(false);
                        theBoard.currentPlayer.giveDevelopmentCard(devC);
                        Board.TheBank.takePayment(theBoard.currentPlayer, Bank.DEV_CARD_COST);
                        theBoard.addEventText(UserMessages.PlayerPurchasedADevCard(theBoard.currentPlayer));

                        theBoard.checkForWinner();
                    } catch (BuildError be)
                    {
                        theBoard.addEventText(be.Message);
                    }
                }
                else if (sender is DevelopmentCard)
                {
                    DevelopmentCard card = (DevelopmentCard)sender;
                    if (card.isPlayable())
                    {
                        switch (card.getType())
                        {
                        case DevelopmentCard.DevCardType.Road:
                            //Player is allowed to place two roads for no cost
                            RoadBuildingEvt evt = new RoadBuildingEvt();
                            evt.beginExecution(theBoard, this);
                            disableEventObjects();
                            //Remove this card from the player's hand.
                            theBoard.currentPlayer.takeDevelopmentCard(card.getType());
                            break;

                        case DevelopmentCard.DevCardType.Plenty:
                            //Player is allowed to take any two resources from the bank
                            YearOfPlentyEvt yr = new YearOfPlentyEvt();
                            yr.beginExecution(theBoard, this);
                            disableEventObjects();
                            //Remove this card from the player's hand. They DO NOT go back to the bank
                            theBoard.currentPlayer.takeDevelopmentCard(card.getType());
                            break;

                        case DevelopmentCard.DevCardType.Knight:
                            //Launch the thief event
                            if (!card.used)
                            {
                                ThiefEvt thevt = new ThiefEvt();
                                thevt.beginExecution(theBoard, this);
                                disableEventObjects();
                                card.used = true;
                                theBoard.checkForWinner();
                            }
                            break;

                        case DevelopmentCard.DevCardType.Monopoly:
                            //Player names a resource, all players give this player that resource they carry
                            MonopolyEvt monEvt = new MonopolyEvt();
                            monEvt.beginExecution(theBoard, this);
                            disableEventObjects();
                            //Remove this card from the player's hand. They DO NOT go back to the bank
                            theBoard.currentPlayer.takeDevelopmentCard(card.getType());
                            break;
                        }
                    }
                    else
                    {
                        if (card.getType() != DevelopmentCard.DevCardType.Victory)
                        {
                            theBoard.addEventText("You must wait until the next turn to play that card.");
                        }
                    }
                }
                else if (sender is Harbor)
                {
                    Harbor hb = (Harbor)sender;
                    if (hb.playerHasValidSettlement(theBoard.currentPlayer))
                    {
                        if (TradeWindow.canPlayerTradeWithHarbor(hb, theBoard.currentPlayer))
                        {
                            disableEventObjects();
                            tradeWindow = new TradeWindow();
                            tradeWindow.loadHarborTrade(hb, theBoard.currentPlayer);
                            tradeWindow.Closing += onTradeEnded;
                            currentState         = State.Trade;
                            tradeWindow.Show();
                        }
                        else
                        {
                            theBoard.addEventText(BuildError.NOT_ENOUGH_RESOURCES);
                        }
                    }
                    else
                    {
                        theBoard.addEventText(UserMessages.PlayerDoesNotHaveAdjascentSettlement);
                    }
                }
                else if (sender is TradeProposition)
                {
                    var proposition = (TradeProposition)sender;
                    Board.TheBank.tradeWithBank(
                        theBoard.currentPlayer,
                        proposition,
                        theBoard.getPlayerBankCosts(theBoard.currentPlayer)
                        );
                    theBoard.addEventText($"{theBoard.currentPlayer.getName()} traded {proposition.selledResource} for {proposition.boughtResource}");
                }
                break;

            case State.Trade:
                //Should not be able to reach this statement.
                break;
            }
            //if (theBoard.currentPlayer.isAI)
            //{
            //    var move = theBoard.currentPlayer.agent.makeMove(theBoard.getBoardState());
            //    executeUpdate(move, null);
            //}
        }
Exemplo n.º 15
0
        public void PerformTurn(IGameState state, IGameActions actions)
        {
            if (!silent)
            {
                Console.WriteLine(id + ": Performing main turn");
            }
            var resources = ((GameState)state).GetOwnResources();

            int[] resCount = new int[5];
            foreach (var r in resources)
            {
                resCount[(int)r]++;
            }
            if (!silent)
            {
                Console.Write(id + ": Resources: ( ");
            }
            foreach (var i in resCount)
            {
                if (!silent)
                {
                    Console.Write(i + " ");
                }
            }
            if (!silent)
            {
                Console.WriteLine(")");
            }

            if (hasDevcardToPlay)
            {
                hasDevcardToPlay = false;
                if (!silent)
                {
                    Console.WriteLine("-----------");
                }
                if (!silent)
                {
                    Console.WriteLine("Has a dev card to play: " + nextToPlay);
                }
                switch (nextToPlay)
                {
                case DevelopmentCard.Knight:
                    if (!silent)
                    {
                        Console.WriteLine("Play knight");
                    }
                    state = ((MainActions)actions).PlayKnight();
                    break;

                case DevelopmentCard.Monopoly:
                    if (!silent)
                    {
                        Console.WriteLine("Play monopoly");
                    }
                    state = ((MainActions)actions).PlayMonopoly(Resource.Ore);
                    break;

                case DevelopmentCard.RoadBuilding:
                    if (!silent)
                    {
                        Console.WriteLine("Play road building");
                    }
                    state = ((MainActions)actions).PlayRoadBuilding(new Edge(27, 28), new Edge(28, 34));
                    break;

                case DevelopmentCard.YearOfPlenty:
                    if (!silent)
                    {
                        Console.WriteLine("Play year of plenty");
                    }
                    state = ((MainActions)actions).PlayYearOfPlenty(Resource.Grain, Resource.Wool);
                    break;
                }
                if (!silent)
                {
                    Console.WriteLine("-----------");
                }
            }
            resources = ((GameState)state).GetOwnResources();

            if (resources.Contains(Resource.Grain) && resources.Contains(Resource.Ore) &&
                resources.Contains(Resource.Wool))
            {
                var prevCards = ((GameState)state).GetOwnDevelopmentCards();
                state = actions.DrawDevelopmentCard();
                if (!silent)
                {
                    Console.WriteLine("Drawn developmentcard successfully");
                }
                hasDevcardToPlay = true;
                var cards = ((GameState)state).GetOwnDevelopmentCards().ToList();
                foreach (var developmentCard in prevCards)
                {
                    cards.Remove(developmentCard);
                }
                nextToPlay = cards.ToArray()[0];
            }
            else
            {
                try
                {
                    actions.DrawDevelopmentCard();
                    if (!silent)
                    {
                        Console.WriteLine("WARNING! Was able to buy a development card with not enough resources");
                    }
                }
                catch (InsufficientResourcesException e)
                {
                    if (!silent)
                    {
                        Console.WriteLine("exceptions was thrown as excpected");
                    }
                }
            }
        }
Exemplo n.º 16
0
        public void PerformTurn(IGameState state, IGameActions actions)
        {
            if (!silent)
                Console.WriteLine(id + ": Performing main turn");
            var resources = ((GameState)state).GetOwnResources();
            int[] resCount = new int[5];
            foreach (var r in resources)
                resCount[(int)r]++;
            if (!silent)
                Console.Write(id + ": Resources: ( ");
            foreach (var i in resCount)
                if (!silent)
                    Console.Write(i + " ");
            if (!silent)
                Console.WriteLine(")");

            if (hasDevcardToPlay)
            {
                hasDevcardToPlay = false;
                if (!silent)
                    Console.WriteLine("-----------");
                if (!silent)
                    Console.WriteLine("Has a dev card to play: " + nextToPlay);
                switch (nextToPlay)
                {
                    case DevelopmentCard.Knight:
                        if (!silent)
                            Console.WriteLine("Play knight");
                        state = ((MainActions) actions).PlayKnight();
                        break;

                    case DevelopmentCard.Monopoly:
                        if (!silent)
                            Console.WriteLine("Play monopoly");
                        state = ((MainActions)actions).PlayMonopoly(Resource.Ore);
                        break;

                    case DevelopmentCard.RoadBuilding:
                        if (!silent)
                            Console.WriteLine("Play road building");
                        state = ((MainActions)actions).PlayRoadBuilding(new Edge(27,28), new Edge(28, 34));
                        break;

                    case DevelopmentCard.YearOfPlenty:
                        if (!silent)
                            Console.WriteLine("Play year of plenty");
                        state = ((MainActions)actions).PlayYearOfPlenty(Resource.Grain, Resource.Wool);
                        break;
                }
                if (!silent)
                    Console.WriteLine("-----------");
            }
            resources = ((GameState)state).GetOwnResources();

            if (resources.Contains(Resource.Grain) && resources.Contains(Resource.Ore) &&
                resources.Contains(Resource.Wool))
            {
                var prevCards = ((GameState) state).GetOwnDevelopmentCards();
                state = actions.DrawDevelopmentCard();
                if (!silent)
                    Console.WriteLine("Drawn developmentcard successfully");
                hasDevcardToPlay = true;
                var cards = ((GameState) state).GetOwnDevelopmentCards().ToList();
                foreach (var developmentCard in prevCards)
                {
                    cards.Remove(developmentCard);
                }
                nextToPlay = cards.ToArray()[0];
            }
            else
            {
                try
                {
                    actions.DrawDevelopmentCard();
                    if (!silent)
                        Console.WriteLine("WARNING! Was able to buy a development card with not enough resources");
                }
                catch (InsufficientResourcesException e)
                {
                    if (!silent)
                        Console.WriteLine("exceptions was thrown as excpected");
                }
            }
        }
Exemplo n.º 17
0
 public void ReserveRevealedCard(DevelopmentCard card)
 {
     GameBoard.Instance.RevealedDevCards.Remove(card);
     ReservedCards.Add(card);
     GetToken(EnumColour.GOLD);
 }
Exemplo n.º 18
0
        private LocalGameControllerTestCreator.TestInstances TestSetup(DevelopmentCard firstDevelopmentCard, params DevelopmentCard[] otherDevelopmentCards)
        {
            var developmentCardHolder = this.CreateMockCardDevelopmentCardHolder(firstDevelopmentCard, otherDevelopmentCards);

            return(this.TestSetup(developmentCardHolder, new GameBoard(BoardSizes.Standard)));
        }
Exemplo n.º 19
0
 private LocalGameControllerTestCreator.TestInstances TestSetup(GameBoard gameBoardData, DevelopmentCard firstDevelopmentCard, params DevelopmentCard[] otherDevelopmentCards)
 {
     return(this.TestSetup(this.CreateMockCardDevelopmentCardHolder(firstDevelopmentCard, otherDevelopmentCards), gameBoardData));
 }
        private LocalGameControllerTestCreator.TestInstances TestSetupWithExplictGameBoard(Guid bankId, DevelopmentCard developmentCard, GameBoard gameBoard)
        {
            MockPlayer         player;
            MockComputerPlayer firstOpponent, secondOpponent, thirdOpponent;

            LocalGameControllerTestCreator.CreateDefaultPlayerInstances(out player, out firstOpponent, out secondOpponent, out thirdOpponent);
            var playerPool = LocalGameControllerTestCreator.CreateMockPlayerPool(player, firstOpponent, secondOpponent, thirdOpponent);

            playerPool.GetBankId().Returns(bankId);

            var playerSetup = new LocalGameControllerTestCreator.PlayerSetup(player, firstOpponent, secondOpponent, thirdOpponent, playerPool);

            var testInstances = LocalGameControllerTestCreator.CreateTestInstances(
                null,
                playerSetup,
                this.CreateMockCardDevelopmentCardHolder(developmentCard),
                gameBoard);
            var localGameController = testInstances.LocalGameController;

            LocalGameControllerTestSetup.LaunchGameAndCompleteSetup(localGameController);

            testInstances.Dice.AddSequence(new[] { 8u }); // First turn roll i.e. no robber triggered

            return(testInstances);
        }
        private LocalGameControllerTestCreator.TestInstances TestSetupWithExplictDevelopmentCards(DevelopmentCard firstDevelopmentCard, params DevelopmentCard[] otherDevelopmentCards)
        {
            var developmentCardHolder = this.CreateMockCardDevelopmentCardHolder(firstDevelopmentCard, otherDevelopmentCards);

            return(this.TestSetupWithExplicitDevelopmentCardHolder(developmentCardHolder));
        }