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


C# Player.MakeChoice方法代码示例

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


在下文中一共展示了Player.MakeChoice方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
			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);
			SupplyCollection gainableSupplies = player._Game.Table.Supplies.FindAll(
				supply => supply.CanGain() && 
					((supply.Category & Cards.Category.Action) == Cards.Category.Action) && 
					supply.CurrentCost <= new Coin(5));
			Choice choice = new Choice("You may gain an Action card costing up to <coin>5</coin>", this, gainableSupplies, player, true);
			ChoiceResult result = player.MakeChoice(choice);
			if (result.Supply != null)
				player.Gain(result.Supply);
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:12,代码来源:Alchemy.cs

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

示例5: Play

		public override void Play(Player player)
		{
			base.Play(player);
			SupplyCollection gainableSupplies = player._Game.Table.Supplies.FindAll(supply => supply.CanGain() && supply.CurrentCost <= new Coin(4));
			Choice choice = new Choice("Gain a card costing up to <coin>4</coin>", this, gainableSupplies, player, false);
			ChoiceResult result = player.MakeChoice(choice);
			if (result.Supply != null)
				player.Gain(result.Supply);
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:9,代码来源:Base.cs

示例6: Play

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

			// Perform attack on every player
			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;

				attackee.Gain(player._Game.Table[TypeClass.RuinsSupply]);
			}

			if (player.Hand[TypeClass.Cultist].Count > 0)
			{
				Choice choicePlayer = Choice.CreateYesNoChoice("Do you want to play a Cultist from your hand?", this, player);
				ChoiceResult resultPlayer = player.MakeChoice(choicePlayer);
				if (resultPlayer.Options[0] == "Yes")
				{
					player.Actions++;
					player.PlayCardInternal(player.Hand[TypeClass.Cultist][0]);
				}
			}
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:28,代码来源:DarkAges.cs

示例7: player_PlusCard

		internal void player_PlusCard(Player player, ref TrashEventArgs e)
		{
			SupplyCollection gainableSupplies = player._Game.Table.Supplies.FindAll(supply => supply.CanGain() && supply.CurrentCost < player._Game.ComputeCost(this));
			Choice choice = new Choice(String.Format("Gain a card costing less than {0}", player._Game.ComputeCost(this).ToString()), 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,代码行数:10,代码来源:DarkAges.cs

示例8: player_Action

		internal void player_Action(Player player, ref CardsDiscardEventArgs e)
		{
			Choice choice = new Choice("Select a treasure to place on your deck", this, e.Cards.Where(c => (c.Category & Category.Treasure) == Cards.Category.Treasure), player);
			ChoiceResult result = player.MakeChoice(choice);
			if (result.Cards.Count > 0)
			{
				e.Cards.Remove(result.Cards[0]);
				if (player.InPlay.Contains(result.Cards[0]))
					player.RetrieveCardFrom(DeckLocation.InPlay, result.Cards[0]);
				else
					player.RetrieveCardFrom(DeckLocation.SetAside, result.Cards[0]);
				player.AddCardToDeck(result.Cards[0], DeckPosition.Top);
			}

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


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