SetKingdomPiles() public method

public SetKingdomPiles ( IEnumerable cards ) : void
cards IEnumerable
return void
Beispiel #1
0
        public Dominion.GameConfig GetGameConfig()
        {
            Dominion.StartingCardSplit player1Split = this.player1Strategy.StartingCardSplit.Value;
            Dominion.StartingCardSplit player2Split = this.player2Strategy.StartingCardSplit.Value;
            Dominion.Card[]            kingdomCards = this.currentDeck.Cards.Where(c => c.cardShapedObject is Card).Select(c => (Card)c.cardShapedObject).ToArray();
            Dominion.Event[]           events       = this.eventCards.Cards.Where(c => c.cardShapedObject is Event).Select(c => (Event)c.cardShapedObject).ToArray();
            Dominion.Landmark[]        landmarks    = this.eventCards.Cards.Where(c => c.cardShapedObject is Landmark).Select(c => (Landmark)c.cardShapedObject).ToArray();
            Dominion.Project[]         projects     = this.eventCards.Cards.Where(c => c.cardShapedObject is Project).Select(c => (Project)c.cardShapedObject).ToArray();
            DominionCard baneCard = this.BaneCard.CurrentCards.FirstOrDefault();

            var builder = new Dominion.GameConfigBuilder();

            builder.SetKingdomPiles(kingdomCards);
            builder.SetEvents(events);
            builder.SetLandmarks(landmarks);
            builder.SetProjects(projects);
            if (baneCard != null)
            {
                builder.SetBaneCard((Card)baneCard.dominionCard);
            }

            builder.useColonyAndPlatinum = this.UseColonyPlatinum.Value;
            builder.useShelters          = this.UseShelters.Value;
            builder.SetCardSplitPerPlayer(new Dominion.StartingCardSplit[] { player1Split, player2Split });

            return(builder.ToGameConfig());
        }