当前位置: 首页>>代码示例>>C#>>正文


C# TurnContext.DrawCards方法代码示例

本文整理汇总了C#中Dominion.Rules.TurnContext.DrawCards方法的典型用法代码示例。如果您正苦于以下问题:C# TurnContext.DrawCards方法的具体用法?C# TurnContext.DrawCards怎么用?C# TurnContext.DrawCards使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Dominion.Rules.TurnContext的用法示例。


在下文中一共展示了TurnContext.DrawCards方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Play

        public void Play(TurnContext context)
        {
            context.DrawCards(1);
            context.RemainingActions += 1;

            context.AddEffect(this, new UpgradeEffect());
        }
开发者ID:anatolilightfoot,项目名称:Dominion,代码行数:7,代码来源:Upgrade.cs

示例2: Play

 public void Play(TurnContext context)
 {
     context.DrawCards(1);
     context.RemainingActions += 1;
     context.Buys += 1;
     context.AvailableSpend += 1;
 }
开发者ID:razzielx,项目名称:Dominion,代码行数:7,代码来源:Market.cs

示例3: OnTurnStarting

            public override void OnTurnStarting(TurnContext context)
            {
                base.OnTurnStarting(context);

                context.DrawCards(1);
                context.Game.Log.LogMessage("Caravan draws an extra card");
            }
开发者ID:razzielx,项目名称:Dominion,代码行数:7,代码来源:Caravan.cs

示例4: Play

        public void Play(TurnContext context)
        {
            context.RemainingActions += 1;
            context.DrawCards(1);

            context.AddLongLivedEffect(new CaravanEffect(this));
        }
开发者ID:trentkerin,项目名称:Dominion,代码行数:7,代码来源:Caravan.cs

示例5: Play

        public void Play(TurnContext context)
        {
            context.RemainingActions += 2;
            context.DrawCards(1);

            var emptyPileCount = context.Game.Bank.EmptyPileCount;
            
            if(emptyPileCount >= 1)
                context.DrawCards(1);

            if(emptyPileCount >= 2)
            {
                context.AvailableSpend += 1;
                context.Buys += 1;
            }

        }
开发者ID:razzielx,项目名称:Dominion,代码行数:17,代码来源:City.cs

示例6: Play

        public void Play(TurnContext context)
        {
            context.DrawCards(4);
            context.Buys += 1;

            foreach (var opponent in context.Opponents)
                opponent.DrawCards(1);
        }
开发者ID:razzielx,项目名称:Dominion,代码行数:8,代码来源:CouncilRoom.cs

示例7: Play

        public void Play(TurnContext context)
        {
            context.RemainingActions += 2;

            context.Game.Log.LogRevealHand(context.ActivePlayer);
            
            if (context.ActivePlayer.Hand.OfType<IActionCard>().Count() == 0) 
                context.DrawCards(2);
        }
开发者ID:razzielx,项目名称:Dominion,代码行数:9,代码来源:ShantyTown.cs

示例8: Play

        public void Play(TurnContext context)
        {
            var activity = Activities.GainACardCostingUpToX(context.Game.Log, context.ActivePlayer, 4, this);
            activity.AfterCardGained = card =>
            {
                if (card is IActionCard) context.RemainingActions += 1;
                if (card is ITreasureCard) context.AvailableSpend += 1;
                if (card is IVictoryCard) context.DrawCards(1);
            };

            context.AddSingleActivity(activity, this);
        }
开发者ID:razzielx,项目名称:Dominion,代码行数:12,代码来源:Ironworks.cs

示例9: Resolve

            public override void Resolve(TurnContext context, ICard source)
            {
                Action discardAction = () =>
                {
                    context.DiscardCards(context.ActivePlayer, context.ActivePlayer.Hand);
                    context.DrawCards(4);
                    DistributeAttacks(context, source);
                };

                Action moneyAction = () => context.AvailableSpend += 2;

                var activity = Activities.ChooseYesOrNo(context.Game.Log, context.ActivePlayer, "Discard your hand?",
                                                        source, discardAction, moneyAction);
                _activities.Add(activity);
            }
开发者ID:razzielx,项目名称:Dominion,代码行数:15,代码来源:Minion.cs

示例10: Resolve

            public override void Resolve(TurnContext context, ICard source)
            {
                var activity = new SelectCardsActivity(
                    context,
                    "Select any number of cards to discard, you will draw 1 new card for each discard",
                    SelectionSpecifications.SelectUpToXCards(context.ActivePlayer.Hand.CardCount), source);

                activity.AfterCardsSelected = cards =>
                {
                    context.DiscardCards(activity.Player, cards);
                    context.DrawCards(cards.Count());
                };

                _activities.Add(activity);
            }
开发者ID:anatolilightfoot,项目名称:Dominion,代码行数:15,代码来源:Cellar.cs

示例11: Play

        public void Play(TurnContext context)
        {
            var leftPlayer = context.Opponents.FirstOrDefault();
            if (leftPlayer != null)
            {
                var revealZone = new RevealZone(leftPlayer);
                leftPlayer.Deck.MoveTop(2, revealZone);
                revealZone.LogReveal(context.Game.Log);

                foreach (var card in revealZone.WithDistinctTypes())
                {
                    if (card is IActionCard) context.RemainingActions += 2;
                    if (card is ITreasureCard) context.AvailableSpend += 2;
                    if (card is IVictoryCard) context.DrawCards(2);
                }

                revealZone.MoveAll(leftPlayer.Discards);
            }


        }
开发者ID:razzielx,项目名称:Dominion,代码行数:21,代码来源:Tribute.cs

示例12: Resolve

            public override void Resolve(TurnContext context, ICard source)
            {
                if (context.ActivePlayer.Hand.CardCount > 0)
                {
                    var activity = new SelectCardsActivity(context, "Select a card to trash",
                                                           SelectionSpecifications.SelectExactlyXCards(1), source);

                    activity.AfterCardsSelected = cardList =>
                    {
                        var cardToTrash = cardList.Single();
                        var cardsToDraw = cardToTrash.Cost.Money;

                        // Notice the card doesn't say its 2 per potion (if we add cards that cost multiple potions)
                        if (cardToTrash.Cost.Potions > 0)
                            cardsToDraw += 2;

                        context.DrawCards(cardsToDraw);
                        context.Trash(context.ActivePlayer, cardToTrash);
                    };
                    _activities.Add(activity);
                }
            }
开发者ID:razzielx,项目名称:Dominion,代码行数:22,代码来源:Apprentice.cs

示例13: Play

 public void Play(TurnContext context)
 {
     context.DrawCards(2);
     context.Buys += 1;
     context.AddLongLivedEffect(new WharfEffect(this));
 }
开发者ID:razzielx,项目名称:Dominion,代码行数:6,代码来源:Wharf.cs

示例14: Play

 public void Play(TurnContext context)
 {
     context.RemainingActions += 1;
     context.DrawCards(3);
     context.AddEffect(this, new WarehouseEffect());
 }
开发者ID:razzielx,项目名称:Dominion,代码行数:6,代码来源:Warehouse.cs

示例15: Play

 public void Play(TurnContext context)
 {
     context.DrawCards(1);
     context.RemainingActions += 2;
     context.AddEffect(this, new MiningVillageEffect(this));
 }
开发者ID:razzielx,项目名称:Dominion,代码行数:6,代码来源:MiningVillage.cs


注:本文中的Dominion.Rules.TurnContext.DrawCards方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。