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


C# Player.AddCardInto方法代码示例

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


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

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

示例2: Play

		public override void Play(Player player)
		{
			base.Play(player);
			// We're looking for 2 non-Golem Action cards
			player.BeginDrawing();
			while (player.Revealed[Category.Action].Count(c => c.CardType != Cards.Alchemy.TypeClass.Golem) < 2 && player.CanDraw)
				player.Draw(DeckLocation.Revealed);

			player.EndDrawing();

			player.Revealed.BeginChanges();
			CardCollection actions = player.Revealed[c => (c.Category & Category.Action) == Category.Action && c.CardType != Cards.Alchemy.TypeClass.Golem];
			player.DiscardRevealed(c => !actions.Contains(c));
			player.Revealed.EndChanges();

			CardCollection cardsToPlay = player.RetrieveCardsFrom(DeckLocation.Revealed);
			Choice choice = new Choice("Which card would you like to play first?", this, actions, player);
			ChoiceResult result = player.MakeChoice(choice);
			if (result.Cards.Count > 0)
			{
				actions.Remove(result.Cards[0]);

				// Play the first (selected) one
				player.AddCardInto(DeckLocation.Private, result.Cards[0]);
				player.Actions++;
				player.PlayCardInternal(result.Cards[0], "first");
			}
			else
				player.PlayNothing("first");

			if (actions.Count > 0)
			{
				// Play the other one
				player.AddCardInto(DeckLocation.Private, actions[0]);
				player.Actions++;
				player.PlayCardInternal(actions[0], "second");
			}
			else
				player.PlayNothing("second");
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:40,代码来源:Alchemy.cs

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

示例4: player_RevealMoat

		internal void player_RevealMoat(Player player, ref AttackedEventArgs e)
		{
			player.AddCardInto(DeckLocation.Revealed, player.RetrieveCardFrom(DeckLocation.Hand, this.PhysicalCard));
			e.Cancelled = true;
			player.AddCardInto(DeckLocation.Hand, player.RetrieveCardFrom(DeckLocation.Revealed, this.PhysicalCard));
			e.HandledBy.Add(TypeClass.Moat);
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:7,代码来源:Base.cs

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

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

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

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

示例9: player_RevealHorseTraders

		internal void player_RevealHorseTraders(Player player, ref AttackedEventArgs e)
		{
			player.AddCardInto(DeckLocation.Revealed, player.RetrieveCardFrom(DeckLocation.Hand, this.PhysicalCard));
			player.AddCardInto(DeckLocation.SetAside, player.RetrieveCardFrom(DeckLocation.Revealed, this.PhysicalCard));
			// Attack isn't cancelled... it's just mitigated
			e.HandledBy.Add(TypeClass.HorseTraders);
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:7,代码来源:Cornucopia.cs

示例10: Play

		public override void Play(Player player)
		{
			base.Play(player);
			if (player.Hand[Category.Treasure].Count > 0)
			{
				Choice choice = new Choice("You may reveal a Treasure card to gain a copy of it.", this, player.Hand[Category.Treasure], player, false, 0, 1);
				ChoiceResult result = player.MakeChoice(choice);
				if (result.Cards.Count > 0)
				{
					player.AddCardInto(DeckLocation.Revealed, player.RetrieveCardFrom(DeckLocation.Hand, result.Cards[0]));
					player.AddCardInto(DeckLocation.Hand, player.RetrieveCardFrom(DeckLocation.Revealed, result.Cards[0]));
					Supply supply = player._Game.Table.FindSupplyPileByCard(result.Cards[0]);
					if (supply != null && supply.TopCard != null && supply.TopCard.Name == result.Cards[0].Name)
						player.Gain(supply);
				}
			}
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:17,代码来源:Prosperity.cs

示例11: player_RevealWatchtower

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

			Choice trashChoice = new Choice(String.Format("Trash {0} or put it on top of your deck?", e.Card), this, new CardCollection() { e.Card }, new List<String>() { "Trash", "Put on Deck" }, player);
			ChoiceResult trashResult = player.MakeChoice(trashChoice);
			if (trashResult.Options[0] == "Trash")
			{
				e.Cancelled = true;
				Card card = player.RetrieveCardFrom(e.Location, e.Card);
				if (card != null)
					player.Trash(e.Card);
				e.IsLostTrackOf = true;
			}
			else
			{
				e.Cancelled = true;
				if (e.Location != DeckLocation.Deck && e.Position != DeckPosition.Top)
				{
					Card c = player.RetrieveCardFrom(e.Location, e.Card);
					e.Location = DeckLocation.Deck;
					e.Position = DeckPosition.Top;
				}
			}

			e.HandledBy.Add(TypeClass.Watchtower);
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:28,代码来源:Prosperity.cs

示例12: Play

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

			if (player.CanDraw)
			{
				Card card = player.Draw(DeckLocation.Revealed);
				if ((card.Category & Cards.Category.Action) == Cards.Category.Action)
				{
					player.Actions++;
					PlayerMode previousPlayerMode = player.PutCardIntoPlay(card, String.Empty);
					Card logicalCard = card.LogicalCard;
					player.PlayCard(logicalCard, previousPlayerMode);
				}
				else
				{
					player.AddCardInto(DeckLocation.Deck, player.RetrieveCardFrom(DeckLocation.Revealed, card), DeckPosition.Top);
				}
			}
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:20,代码来源:Guilds.cs

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