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


C# Player.Discard方法代码示例

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


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

示例1: Play

		public override void Play(Player player)
		{
			base.Play(player);
			player.Draw(3, DeckLocation.Revealed);

			IEnumerator<Player> enumerator = player._Game.GetPlayersStartingWithEnumerator(player);
			enumerator.MoveNext(); // Gets us... which we don't care about here.
			enumerator.MoveNext(); // Get the player to our left

			Player leftPlayer = enumerator.Current;
			Choice choice = new Choice(String.Format("Choose a card of {0}'s to discard", player), this, player.Revealed, player);
			ChoiceResult result = leftPlayer.MakeChoice(choice);
			// Discard the chosen card
			if (result.Cards.Count > 0)
				player.Discard(DeckLocation.Revealed, result.Cards[0]);
			player.AddCardsToHand(DeckLocation.Revealed);
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:17,代码来源:Guilds.cs

示例2: Play

		public override void Play(Player player)
		{
			base.Play(player);
			if (player.Hand[Cards.Universal.TypeClass.Estate].Count > 0)
			{
				Choice choice = Choice.CreateYesNoChoice("You may discard an Estate card for +<coin>4</coin>.  Do you want to discard?", this, player);
				ChoiceResult result = player.MakeChoice(choice);
				if (result.Options.Contains("Yes"))
				{
					player.Discard(DeckLocation.Hand, Cards.Universal.TypeClass.Estate, 1);

					CardBenefit benefit = new CardBenefit();
					benefit.Currency.Coin += 4;
					player.ReceiveBenefit(this, benefit);

					return;
				}
			}

			player.Gain(player._Game.Table.Estate);
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:21,代码来源:Intrigue.cs

示例3: Play

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

			Choice choice = new Choice("Discard 2 cards.", this, player.Hand, player, false, 2, 2);
			ChoiceResult result = player.MakeChoice(choice);
			player.Discard(DeckLocation.Hand, result.Cards);
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:8,代码来源:Hinterlands.cs

示例4: Play

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

			CardCollection newCards = player.Draw(3, DeckLocation.Private);

			Choice trashChoice = new Choice("Choose a card to trash", this, newCards, player);
			ChoiceResult trashResult = player.MakeChoice(trashChoice);
			if (trashResult.Cards.Count > 0)
			{
				newCards.Remove(trashResult.Cards[0]);
				player.Trash(player.RetrieveCardFrom(DeckLocation.Private, trashResult.Cards[0]));
			}

			Choice discardChoice = new Choice("Choose a card to discard", this, newCards, player);
			ChoiceResult discardResult = player.MakeChoice(discardChoice);
			if (discardResult.Cards.Count > 0)
			{
				newCards.Remove(discardResult.Cards[0]);
				player.Discard(DeckLocation.Private, discardResult.Cards[0]);
			}

			player.AddCardsToDeck(player.RetrieveCardsFrom(DeckLocation.Private), DeckPosition.Top);
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:24,代码来源:Seaside.cs

示例5: Play

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

			Choice choiceTheFirst = new Choice("Choose one:", this, new CardCollection() { this }, new List<string>() { "Discard 2 cards", "Put a card on your deck", "Gain a Copper" }, player);
			ChoiceResult resultTheFirst = player.MakeChoice(choiceTheFirst);
			if (resultTheFirst.Options.Contains("Discard 2 cards"))
			{
				Choice choiceDiscard = new Choice("Discard 2 cards.", this, player.Hand, player, false, 2, 2);
				ChoiceResult resultDiscard = player.MakeChoice(choiceDiscard);
				player.Discard(DeckLocation.Hand, resultDiscard.Cards);
			}
			else if (resultTheFirst.Options.Contains("Put a card on your deck"))
			{
				Choice replaceChoice = new Choice("Choose a card to put back on your deck", this, player.Hand, player, false, 1, 1);
				ChoiceResult replaceResult = player.MakeChoice(replaceChoice);
				player.RetrieveCardsFrom(DeckLocation.Hand, replaceResult.Cards);
				player.AddCardsToDeck(replaceResult.Cards, DeckPosition.Top);
			}
			else
			{
				player.Gain(player._Game.Table.Copper);
			}

			Choice choiceTheSecond = new Choice("Choose one:", this, new CardCollection() { this }, new List<string>() { "+<coin>3</coin>", "Trash your hand", "Gain a Duchy" }, player);
			ChoiceResult resultTheSecond = player.MakeChoice(choiceTheSecond);
			if (resultTheSecond.Options.Contains("+<coin>3</coin>"))
			{
				player.ReceiveBenefit(this, new CardBenefit() { Currency = new Currency(3) });
			}
			else if (resultTheSecond.Options.Contains("Trash your hand"))
			{
				player.Trash(player.RetrieveCardsFrom(DeckLocation.Hand));
			}
			else
			{
				player.Gain(player._Game.Table.Duchy);
			}
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:39,代码来源:DarkAges.cs

示例6: player_RevealBeggar

		internal void player_RevealBeggar(Player player, ref AttackedEventArgs e)
		{
			player.Discard(DeckLocation.Hand, this.PhysicalCard);
			player.Gain(player._Game.Table.Silver, DeckLocation.Deck, DeckPosition.Top);
			player.Gain(player._Game.Table.Silver);

			e.HandledBy.Add(TypeClass.Beggar);

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

示例7: Play

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

			Choice choice = new Choice("Discard any number of cards.  +<coin>1</coin> per card discarded.", this, player.Hand, player, false, 0, player.Hand.Count);
			ChoiceResult result = player.MakeChoice(choice);

			player.Discard(DeckLocation.Hand, result.Cards);

			CardBenefit benefit = new CardBenefit();
			benefit.Currency += new Coin(result.Cards.Count);
			player.ReceiveBenefit(this, benefit);

			IEnumerator<Player> enumerator = player._Game.GetPlayersStartingWithEnumerator(player);
			enumerator.MoveNext(); // skip active player
			while (enumerator.MoveNext())
			{
				Player otherPlayer = enumerator.Current;
				if (otherPlayer.Hand.Count >= 2)
				{
					Choice choicePlayer = Choice.CreateYesNoChoice("Do you want to discard 2 cards to draw 1 card?", this, otherPlayer);
					ChoiceResult resultPlayer = otherPlayer.MakeChoice(choicePlayer);
					if (resultPlayer.Options[0] == "Yes")
					{
						Choice choiceDiscard = new Choice("Choose 2 cards to discard", this, otherPlayer.Hand, otherPlayer, false, 2, 2);
						ChoiceResult discards = otherPlayer.MakeChoice(choiceDiscard);
						otherPlayer.Discard(DeckLocation.Hand, discards.Cards);

						if (otherPlayer.CanDraw)
							otherPlayer.Draw(DeckLocation.Hand);
					}
				}
			}

			this.Benefit.Currency.Coin.Value = 0;
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:36,代码来源:Prosperity.cs

示例8: Overpay

		public override void Overpay(Player player, Currency amount)
		{
			for (int i = 0; i < amount.Coin.Value; i++)
			{
				if (!player.CanDraw)
					break;
				Card card = player.Draw(DeckLocation.Private);
				Choice choice = new Choice(String.Format("Do you want to discard {0}, trash {0}, or put it back on top?", card.Name), this, new CardCollection() { card }, new List<string>() { "Discard", "Trash", "Put it back" }, player);
				ChoiceResult result = player.MakeChoice(choice);
				switch (result.Options[0])
				{
					case "Discard":
						player.Discard(DeckLocation.Private);
						break;
					case "Trash":
						player.Trash(DeckLocation.Private, card);
						break;
					default:
						player.AddCardsToDeck(player.RetrieveCardsFrom(DeckLocation.Private), DeckPosition.Top);
						break;
				}
			}
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:23,代码来源:Guilds.cs

示例9: player_DiscardMarketSquare

		internal void player_DiscardMarketSquare(Player player, ref TrashEventArgs e)
		{
			player.Discard(DeckLocation.Hand, this);
			player.Gain(player._Game.Table.Gold);

			e.HandledBy.Add(this);
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:7,代码来源:DarkAges.cs

示例10: Play

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

			Choice choiceAction = new Choice("You may discard a card for +1 Action.", this, player.Hand, player, false, 0, 1);
			ChoiceResult resultAction = player.MakeChoice(choiceAction);
			if (resultAction.Cards.Count > 0)
			{
				player.Discard(DeckLocation.Hand, resultAction.Cards);
				player.ReceiveBenefit(this, new CardBenefit() { Actions = 1 });
			}

			Choice choiceBuy = new Choice("You may discard a card for +1 Buy.", this, player.Hand, player, false, 0, 1);
			ChoiceResult resultBuy = player.MakeChoice(choiceBuy);
			if (resultBuy.Cards.Count > 0)
			{
				player.Discard(DeckLocation.Hand, resultBuy.Cards);
				player.ReceiveBenefit(this, new CardBenefit() { Buys = 1 });
			}
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:20,代码来源:Cornucopia.cs

示例11: Play

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

			Choice choiceDiscard = new Choice("Choose cards to discard", this, player.Hand, player, false, 0, player.Hand.Count);
			ChoiceResult resultDiscard = player.MakeChoice(choiceDiscard);
			player.Discard(DeckLocation.Hand, resultDiscard.Cards);

			player.ReceiveBenefit(this, new CardBenefit() { Cards = resultDiscard.Cards.Count });
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:10,代码来源:Base.cs


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