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


C# Player.Gain方法代码示例

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


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

示例1: Play

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

			player.Gain(player._Game.Table.Silver, DeckLocation.Deck, DeckPosition.Top);

			// Perform attack on every player (including you)
			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 (attackee.Hand[Category.Victory].Count == 0)
				{
					attackee.ReturnHand(attackee.RevealHand());
				}
				else
				{
					Choice replaceChoice = new Choice("Choose a card to put back on your deck", this, attackee.Hand[Category.Victory], attackee);
					ChoiceResult replaceResult = attackee.MakeChoice(replaceChoice);
					if (replaceResult.Cards.Count > 0)
					{
						Card returnCard = attackee.RetrieveCardFrom(DeckLocation.Hand, replaceResult.Cards[0]);
						attackee.AddCardInto(DeckLocation.Revealed, returnCard);
						attackee.AddCardToDeck(attackee.RetrieveCardFrom(DeckLocation.Revealed, returnCard), DeckPosition.Top);
					}
				}
			}
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:33,代码来源:Base.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);

			player.Gain(player._Game.Table.Copper, DeckLocation.Hand, DeckPosition.Automatic, 3);
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:6,代码来源:DarkAges.cs

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

示例5: player_GainCache

		internal void player_GainCache(Player player, ref Players.CardGainEventArgs e)
		{
			player.Gain(player._Game.Table[TypeClass.RuinsSupply], 2);

			e.HandledBy.Add(TypeClass.DeathCart);

			// Clear out the Event Triggers -- this only happens when its Gained, so we don't care any more
			foreach (Player playerLoop in _CardGainedHandlers.Keys)
				playerLoop.CardGained -= _CardGainedHandlers[playerLoop];
			_CardGainedHandlers.Clear();
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:11,代码来源:DarkAges.cs

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

示例7: player_PlusCard

		internal void player_PlusCard(Player player, ref TrashEventArgs e)
		{
			Choice choice = new Choice("Choose one:", this, new CardCollection() { this }, new List<string>() { "Gain a Duchy", "Gain 3 Estates" }, player);
			ChoiceResult result = player.MakeChoice(choice);
			if (result.Options.Contains("Gain a Duchy"))
			{
				player.Gain(player._Game.Table.Duchy);
			}
			else
			{
				player.Gain(player._Game.Table.Estate, 3);
			}

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

示例8: player_GainGold

		internal void player_GainGold(Player player, ref TrashEventArgs e)
		{
			player.Gain(player._Game.Table.Gold);

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

示例9: player_Gain3Silvers

		internal void player_Gain3Silvers(Player player, ref TrashEventArgs e)
		{
			player.Gain(player._Game.Table.Silver, 3);

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

示例10: player_GainAttack

		internal void player_GainAttack(Player player, ref TrashEventArgs e)
		{
			SupplyCollection gainableSupplies = player._Game.Table.Supplies.FindAll(
				supply => supply.CanGain() &&
					((supply.Category & Cards.Category.Attack) == Cards.Category.Attack));
			Choice choice = new Choice("Gain an Attack card", this, gainableSupplies, player, false);
			ChoiceResult result = player.MakeChoice(choice);
			if (result.Supply != null)
				player.Gain(result.Supply);

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

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

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


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