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


C# Player.AddCardToHand方法代码示例

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


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

示例1: Play

		public override void Play(Player player)
		{
			base.Play(player);
			while (player.Hand.Count < 7 && player.CanDraw)
			{
				Card card = player.Draw(DeckLocation.Private);
				if ((card.Category & Category.Action) == Category.Action)
				{
					Choice choice = Choice.CreateYesNoChoice(String.Format("Would you like to set aside {0}?", card.Name), this, card, player, null);
					ChoiceResult result = player.MakeChoice(choice);
					if (result.Options[0] == "Yes")
					{
						player.AddCardInto(DeckLocation.Revealed, player.RetrieveCardFrom(DeckLocation.Private, card));
					}
					else if (result.Options[0] == "No")
					{
						player.AddCardToHand(player.RetrieveCardFrom(DeckLocation.Private, card));
					}
				}
				else
				{
					player.AddCardToHand(player.RetrieveCardFrom(DeckLocation.Private, card));
				}
			}
			player.DiscardRevealed();
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:26,代码来源:Base.cs

示例2: Play

		public override void Play(Player player)
		{
			base.Play(player);

			player.BeginDrawing();
			while (player.CanDraw)
			{
				player.Draw(DeckLocation.Revealed);
				if (player._Game.ComputeCost(player.Revealed.Last()) >= new Cost(3))
					break;
			}
			player.EndDrawing();

			if (player.Revealed.Count > 0)
			{
				Card lastCard = player.Revealed.Last();
				if (player._Game.ComputeCost(player.Revealed.Last()) >= new Cost(3))
					player.AddCardToHand(player.RetrieveCardFrom(DeckLocation.Revealed, lastCard));
			}

			player.DiscardRevealed();
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:22,代码来源:DarkAges.cs

示例3: Play

		public override void Play(Player player)
		{
			base.Play(player);

			player.ReturnHand(player.RevealHand());

			Boolean foundUniqueCard = false;
			player.BeginDrawing();
			while (player.CanDraw)
			{
				player.Draw(DeckLocation.Revealed);
				if (player.Hand[player.Revealed.Last().CardType].Count == 0)
				{
					foundUniqueCard = true;
					break;
				}
			}
			player.EndDrawing();

			if (foundUniqueCard && player.Revealed.Count > 0)
				player.AddCardToHand(player.RetrieveCardFrom(DeckLocation.Revealed, player.Revealed.Last()));

			player.DiscardRevealed();
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:24,代码来源:Cornucopia.cs

示例4: PlayDuration

		public override void PlayDuration(Player player)
		{
			base.PlayDuration(player);

			player.ReceiveBenefit(this, new CardBenefit() { Cards = 1 });
			player.AddCardToHand(player.RetrieveCardFrom(DeckLocation.SetAside, this));
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:7,代码来源:Cornucopia.cs

示例5: player_RevealSecretChamber

		internal void player_RevealSecretChamber(Player player, ref AttackedEventArgs e)
		{
			player.AddCardInto(DeckLocation.Revealed, player.RetrieveCardFrom(DeckLocation.Hand, this.PhysicalCard));
			player.AddCardToHand(player.RetrieveCardFrom(DeckLocation.Revealed, this.PhysicalCard));

			player.Draw(2, DeckLocation.Hand);

			Choice replaceChoice = new Choice("Choose order of cards to put back on your deck", this, new CardCollection() { e.AttackCard }, player.Hand, player, true, 2, 2);
			ChoiceResult replaceResult = player.MakeChoice(replaceChoice);
			player.RetrieveCardsFrom(DeckLocation.Hand, replaceResult.Cards);
			player.AddCardsToDeck(replaceResult.Cards, DeckPosition.Top);

			e.HandledBy.Add(TypeClass.SecretChamber);

			// Attack isn't cancelled... it's just mitigated
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:16,代码来源:Intrigue.cs


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