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


C# Player.BeginDrawing方法代码示例

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


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

示例1: Play

		public override void Play(Player player)
		{
			base.Play(player);
			player.BeginDrawing();
			while (player.Revealed[Category.Treasure].Count < 2 && player.CanDraw)
				player.Draw(DeckLocation.Revealed);

			player.EndDrawing();

			player.AddCardsToHand(player.RetrieveCardsFrom(DeckLocation.Revealed, c => (c.Category & Category.Treasure) == Category.Treasure));

			player.DiscardRevealed();
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:13,代码来源:Base.cs

示例2: Play

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

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

				if (attackee.CanDraw)
				{
					Card card = attackee.Draw(DeckLocation.Revealed);
					Choice choice = new Choice(String.Format("Do you want to discard {0}'s {1} or put it back on top?", attackee.Name, card.Name), this, new CardCollection() { card }, new List<string>() { "Discard", "Put it back" }, attackee);
					ChoiceResult result = player.MakeChoice(choice);
					if (result.Options[0] == "Discard")
						attackee.DiscardRevealed();
					else
						attackee.AddCardsToDeck(attackee.RetrieveCardsFrom(DeckLocation.Revealed), DeckPosition.Top);
				}
			}

			player.BeginDrawing();
			// Keep flipping cards until we hit a non-Action card, thus making the counts different
			while (player.CanDraw && player.Revealed[Category.Action].Count == player.Revealed.Count)
				player.Draw(DeckLocation.Revealed);

			player.EndDrawing();
			player.AddCardsToHand(DeckLocation.Revealed);
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:33,代码来源:Alchemy.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)
		{
			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

示例5: Play

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

			player.BeginDrawing();
			while (player.Revealed[Category.Treasure].Count < 1 && player.CanDraw)
				player.Draw(DeckLocation.Revealed);

			player.EndDrawing();

			CardCollection treasureCards = player.Revealed[c => (c.Category & Category.Treasure) == Category.Treasure];
			if (treasureCards.Count > 0)
			{
				Card card = treasureCards[0];
				Choice choice = new Choice(String.Format("You revealed a {0}.", card.Name), this, new CardCollection() { card }, new List<string>() { "Discard it", "Trash it" }, player);
				ChoiceResult result = player.MakeChoice(choice);
				if (result.Options[0] == "Discard it")
				{
					player.Discard(DeckLocation.Revealed, card);
				}
				else if (result.Options[0] == "Trash it")
				{
					player.Trash(player.RetrieveCardFrom(DeckLocation.Revealed, card));
				}
			}
			player.DiscardRevealed();
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:27,代码来源:Prosperity.cs


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