本文整理汇总了C#中DominionBase.Players.Player.Draw方法的典型用法代码示例。如果您正苦于以下问题:C# Player.Draw方法的具体用法?C# Player.Draw怎么用?C# Player.Draw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DominionBase.Players.Player
的用法示例。
在下文中一共展示了Player.Draw方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例2: Play
public override void Play(Player player)
{
base.Play(player);
player.Draw(3, DeckLocation.Revealed);
IEnumerator<Player> enumerator = player._Game.GetPlayersStartingWithEnumerator(player);
enumerator.MoveNext(); // Gets us... which we don't care about here.
enumerator.MoveNext(); // Get the player to our left
Player leftPlayer = enumerator.Current;
Choice choice = new Choice(String.Format("Choose a card of {0}'s to discard", player), this, player.Revealed, player);
ChoiceResult result = leftPlayer.MakeChoice(choice);
// Discard the chosen card
if (result.Cards.Count > 0)
player.Discard(DeckLocation.Revealed, result.Cards[0]);
player.AddCardsToHand(DeckLocation.Revealed);
}
示例3: Play
public override void Play(Player player)
{
base.Play(player);
player.Draw(5, DeckLocation.Private);
Choice keepDiscard = new Choice(String.Format("You drew: {1}{0}Do you want to discard them all or put them back on your deck?", System.Environment.NewLine, player.Private), this, new CardCollection(player.Private), new List<String>() { "Discard them all", "Put them back" }, player);
ChoiceResult keepDiscardResult = player.MakeChoice(keepDiscard);
if (keepDiscardResult.Options[0] == "Discard them all")
{
player.Discard(DeckLocation.Private, player.Private);
}
else
{
Choice replaceChoice = new Choice("Choose order of cards to put back on your deck", this, player.Private, player, true, player.Private.Count, player.Private.Count);
ChoiceResult replaceResult = player.MakeChoice(replaceChoice);
player.AddCardsToDeck(player.RetrieveCardsFrom(DeckLocation.Private, replaceResult.Cards), DeckPosition.Top);
}
}
示例4: 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);
}
示例5: Play
public override void Play(Player player)
{
base.Play(player);
player.Draw(5, DeckLocation.Revealed);
}
示例6: Play
public override void Play(Player player)
{
base.Play(player);
player.Draw(3, DeckLocation.Revealed);
CardCollection actionCards = player.Revealed[Cards.Category.Action];
Choice replaceChoice = new Choice("Choose order of cards to put back on your deck", this, actionCards, player, true, actionCards.Count, actionCards.Count);
ChoiceResult replaceResult = player.MakeChoice(replaceChoice);
player.AddCardsToDeck(player.RetrieveCardsFrom(DeckLocation.Revealed, replaceResult.Cards), DeckPosition.Top);
player.DiscardRevealed();
}
示例7: 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 cards = player.Revealed[Cards.Category.Treasure];
player.DiscardRevealed(c => !cards.Contains(c));
if (cards.Count > 0)
player.PlayCardInternal(cards[0]);
}
示例8: Overpay
public override void Overpay(Player player, Currency amount)
{
for (int i = 0; i < amount.Coin.Value; i++)
{
if (!player.CanDraw)
break;
Card card = player.Draw(DeckLocation.Private);
Choice choice = new Choice(String.Format("Do you want to discard {0}, trash {0}, or put it back on top?", card.Name), this, new CardCollection() { card }, new List<string>() { "Discard", "Trash", "Put it back" }, player);
ChoiceResult result = player.MakeChoice(choice);
switch (result.Options[0])
{
case "Discard":
player.Discard(DeckLocation.Private);
break;
case "Trash":
player.Trash(DeckLocation.Private, card);
break;
default:
player.AddCardsToDeck(player.RetrieveCardsFrom(DeckLocation.Private), DeckPosition.Top);
break;
}
}
}
示例9: 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
}
示例10: Play
public override void Play(Player player)
{
base.Play(player);
CardCollection newCards = player.Draw(4, DeckLocation.Revealed);
player.AddCardsToHand(player.RetrieveCardsFrom(DeckLocation.Revealed, Category.Victory));
Choice replaceChoice = new Choice("Choose order of cards to put back on your deck", this, player.Revealed, player, true, player.Revealed.Count, player.Revealed.Count);
ChoiceResult replaceResult = player.MakeChoice(replaceChoice);
player.RetrieveCardsFrom(DeckLocation.Revealed, replaceResult.Cards);
player.AddCardsToDeck(replaceResult.Cards, DeckPosition.Top);
}
示例11: Play
public override void Play(Player player)
{
base.Play(player);
player.BeginDrawing();
while (player.CanDraw)
{
player.Draw(DeckLocation.Revealed);
Card lastRevealed = player.Revealed.Last();
if ((lastRevealed.Category & Cards.Category.Action) == Cards.Category.Action ||
(lastRevealed.Category & Cards.Category.Treasure) == Cards.Category.Treasure)
break;
}
player.EndDrawing();
if (player.Revealed.Count > 0)
player.AddCardToHand(player.RetrieveCardFrom(DeckLocation.Revealed, player.Revealed.Last()));
player.DiscardRevealed();
}
示例12: Play
public override void Play(Player player)
{
base.Play(player);
player.Draw(4, DeckLocation.Private);
Choice choiceDiscard = new Choice("Choose cards to discard", this, player.Private, player, false, 0, player.Private.Count);
ChoiceResult resultDiscard = player.MakeChoice(choiceDiscard);
player.Discard(DeckLocation.Private, resultDiscard.Cards);
Choice replaceChoice = new Choice("Choose order of cards to put back on your deck", this, player.Private, player, true, player.Private.Count, player.Private.Count);
ChoiceResult replaceResult = player.MakeChoice(replaceChoice);
player.AddCardsToDeck(player.RetrieveCardsFrom(DeckLocation.Private, replaceResult.Cards), DeckPosition.Top);
}