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


C# Player.RetrieveCardFrom方法代码示例

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


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

示例1: player_Action

		internal void player_Action(Player player, ref CardsDiscardEventArgs e)
		{
			e.Cards.Remove(this.PhysicalCard);
			Card thisCard = null;
			if (player.InPlay.Contains(this.PhysicalCard))
				thisCard = player.RetrieveCardFrom(DeckLocation.InPlay, this.PhysicalCard);
			else
				thisCard = player.RetrieveCardFrom(DeckLocation.SetAside, this.PhysicalCard);
			player.AddCardToDeck(thisCard, DeckPosition.Top);
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:10,代码来源:Alchemy.cs

示例2: Play

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

			Choice choiceCard = new Choice("Reveal a card from your hand to return up to 2 to the Supply.", this, player.Hand, player);
			ChoiceResult resultCard = player.MakeChoice(choiceCard);

			if (resultCard.Cards.Count > 0)
			{
				Card revealedCard = resultCard.Cards[0];
				player.AddCardInto(DeckLocation.Revealed, player.RetrieveCardFrom(DeckLocation.Hand, revealedCard));
				player.AddCardInto(DeckLocation.Hand, player.RetrieveCardFrom(DeckLocation.Revealed, revealedCard));

				Supply supply = player._Game.Table.FindSupplyPileByCard(revealedCard);
				if (supply != null)
				{
					List<String> options = new List<string>() { "0", "1" };
					if (player.Hand[revealedCard.CardType].Count > 1)
						options.Add("2");
					Choice choice = new Choice("How many would you like to return to the Supply?", this, new CardCollection() { revealedCard }, options, player);
					ChoiceResult result = player.MakeChoice(choice);

					int numberToReturn = int.Parse(result.Options[0]);
					if (numberToReturn > 0)
					{
						CardCollection cardsToReturn = player.RetrieveCardsFrom(DeckLocation.Hand, revealedCard.CardType, numberToReturn);
						player.Lose(cardsToReturn);
						supply.AddTo(cardsToReturn);
					}

					player._Game.SendMessage(player, this, supply, numberToReturn);
				}

				IEnumerator<Player> enumerator = player._Game.GetPlayersStartingWithEnumerator(player);
				enumerator.MoveNext();
				while (enumerator.MoveNext())
				{
					Player attackee = enumerator.Current;
					// Skip if the attack is blocked (Moat, Lighthouse, etc.)
					if (this.IsAttackBlocked[attackee])
						continue;

					if (supply != null && supply.CanGain() && supply.TopCard.Name == revealedCard.Name)
						attackee.Gain(supply);
				}
			}
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:47,代码来源:Seaside.cs

示例3: 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

示例4: Play

		public override void Play(Player player)
		{
			Choice choice = new Choice("Trash a card.", this, player.Hand, player);
			ChoiceResult result = player.MakeChoice(choice);
			if (result.Cards.Count > 0)
			{
				Card trash = player.RetrieveCardFrom(DeckLocation.Hand, result.Cards[0]);

				player.Trash(trash);
				if ((trash.Category & Category.Action) == Category.Action)
					player.Gain(player._Game.Table.Duchy);
				if ((trash.Category & Category.Treasure) == Category.Treasure)
					player.Gain(player._Game.Table[Cards.Alchemy.TypeClass.Transmute]);
				if ((trash.Category & Category.Victory) == Category.Victory)
					player.Gain(player._Game.Table.Gold);
			}

			base.Play(player);
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:19,代码来源:Alchemy.cs

示例5: 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

示例6: Play

		public override void Play(Player player)
		{
			base.Play(player);
			if (player.InPlay.Contains(this.PhysicalCard))
			{
				Choice choice = Choice.CreateYesNoChoice("Do you want to set this card aside?", this, player);
				ChoiceResult result = player.MakeChoice(choice);
				if (result.Options[0] == "Yes")
				{
					player.AddCardInto(TypeClass.PrinceSetAside, player.RetrieveCardFrom(DeckLocation.InPlay, this.PhysicalCard));

					if (_TurnStartedEventHandler != null)
						player.TurnStarted -= _TurnStartedEventHandler;
					_TurnStartedPlayer = player;
					_TurnStartedEventHandler = new Player.TurnStartedEventHandler(player_TurnStarted);
					_TurnStartedPlayer.TurnStarted += _TurnStartedEventHandler;

					Choice setAsideChoice = new Choice("Choose a card to set aside", this, player.Hand[c => (c.Category & Cards.Category.Action) == Cards.Category.Action && player._Game.ComputeCost(c) <= new Coin(4)], player, false, 1, 1);
					ChoiceResult setAsideResult = player.MakeChoice(setAsideChoice);
					if (setAsideResult.Cards.Count > 0)
					{
						_SetAsideCard = player.RetrieveCardFrom(DeckLocation.Hand, setAsideResult.Cards[0]);
						player.PlayerMats[TypeClass.PrinceSetAside].Refresh(player);
						player._Game.SendMessage(player, this, this._SetAsideCard);
					}

				}
			}
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:29,代码来源:Promotional.cs

示例7: 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

示例8: player_FoolsGold

		internal void player_FoolsGold(Player player, ref Players.CardGainEventArgs e)
		{
			if (player.Hand.Contains(this.PhysicalCard))
			{
				player.AddCardInto(DeckLocation.Revealed, player.RetrieveCardFrom(DeckLocation.Hand, this.PhysicalCard));
				player.Trash(player.RetrieveCardFrom(DeckLocation.Revealed, this.PhysicalCard));
				player.Gain(player._Game.Table.Gold, DeckLocation.Deck, DeckPosition.Top);
				e.HandledBy.Add(TypeClass.FoolsGold);
			}
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:10,代码来源:Hinterlands.cs

示例9: player_Action

		internal void player_Action(Player player, ref CardsDiscardEventArgs e)
		{
			e.Cards.Remove(this.PhysicalCard);
			if (player.InPlay.Contains(this.PhysicalCard))
				player.Trash(player.RetrieveCardFrom(DeckLocation.InPlay, this.PhysicalCard));
			else if (player.SetAside.Contains(this.PhysicalCard))
				player.Trash(player.RetrieveCardFrom(DeckLocation.SetAside, this.PhysicalCard));

			player.Gain(player._Game.Table.SpecialPiles[TypeClass.Madman]);

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

示例10: player_RevealTrader

		internal void player_RevealTrader(Player player, ref Players.CardGainEventArgs e)
		{
			player.AddCardInto(DeckLocation.Revealed, player.RetrieveCardFrom(DeckLocation.Hand, this));
			player.AddCardInto(DeckLocation.Hand, player.RetrieveCardFrom(DeckLocation.Revealed, this));

			// Cancel the gain, add the card back to the Supply pile, and then Gain a Silver instead.
			e.Cancelled = true;
			e.IsLostTrackOf = true;
			//player._Game.Table.Supplies[e.Card].AddTo(e.Card);
			player._Game.SendMessage(player, this, e.Card, player._Game.Table.Silver);
			player.Gain(player._Game.Table.Silver);
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:12,代码来源:Hinterlands.cs

示例11: player_DiscardTunnel

		internal void player_DiscardTunnel(Player player, ref CardsDiscardEventArgs e)
		{
			player.AddCardInto(DeckLocation.Revealed, this);
			player.RetrieveCardFrom(DeckLocation.Revealed, this);
			player.Gain(player._Game.Table.Gold);
			e.HandledBy.Add(this);
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:7,代码来源:Hinterlands.cs

示例12: Play

		public override void Play(Player player)
		{
			base.Play(player);
			Choice choice = new Choice("You may choose a Treasure card to trash", this, player.Hand[Cards.Category.Treasure], player, false, 0, 1);
			ChoiceResult result = player.MakeChoice(choice);
			if (result.Cards.Count > 0)
			{
				player.Trash(player.RetrieveCardFrom(DeckLocation.Hand, result.Cards[0]));

				CardBenefit benefit = new CardBenefit();
				Choice choiceBenefit = new Choice("Choose either +2 Cards and +1 Action; or +<coin>2</coin> and +1 Buy", this, new CardCollection() { this }, new List<string>() { "+2<nbsp/>Cards and +1<nbsp/>Action", "+<coin>2</coin> and +1<nbsp/>Buy" }, player);
				ChoiceResult resultBenefit = player.MakeChoice(choiceBenefit);
				if (resultBenefit.Options[0] == "+2<nbsp/>Cards and +1<nbsp/>Action")
				{
					benefit.Cards = 2;
					benefit.Actions = 1;
				}
				else
				{
					benefit.Currency.Coin.Value = 2;
					benefit.Buys = 1;
				}

				player.ReceiveBenefit(this, benefit);
			}
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:26,代码来源:Hinterlands.cs

示例13: player_DiscardAction

		internal void player_DiscardAction(Player player, ref CardsDiscardEventArgs e)
		{
			Card cardToTopDeck = e.Data as Card;
			e.Cards.Remove(cardToTopDeck);
			if (player.InPlay.Contains(cardToTopDeck))
				player.RetrieveCardFrom(DeckLocation.InPlay, cardToTopDeck);
			else
				player.RetrieveCardFrom(DeckLocation.SetAside, cardToTopDeck);
			player.AddCardToDeck(cardToTopDeck, DeckPosition.Top);

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

示例14: 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

示例15: player_TrashHovel

		internal void player_TrashHovel(Player player, ref Players.CardBuyEventArgs e)
		{
			player.Trash(player.RetrieveCardFrom(DeckLocation.Hand, this.PhysicalCard));

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


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