本文整理汇总了C#中DominionBase.Players.Player.AddCardsToDeck方法的典型用法代码示例。如果您正苦于以下问题:C# Player.AddCardsToDeck方法的具体用法?C# Player.AddCardsToDeck怎么用?C# Player.AddCardsToDeck使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DominionBase.Players.Player
的用法示例。
在下文中一共展示了Player.AddCardsToDeck方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Play
public override void Play(Player player)
{
base.Play(player);
CardCollection newCards = player.Draw(2, DeckLocation.Private);
if (newCards.Count > 0)
{
Choice choice = new Choice(
String.Format("Do you want to discard {0} or put {1} back on top?", String.Join(" and ", newCards.Select(c => c.Name)), newCards.Count == 1 ? "it" : "them"),
this,
newCards,
new List<string>() { "Discard", String.Format("Put {0} back", newCards.Count == 1 ? "it" : "them") },
player);
ChoiceResult result = player.MakeChoice(choice);
if (result.Options[0] == "Discard")
player.Discard(DeckLocation.Private);
else
{
Choice replaceChoice = new Choice("Choose order of cards to put back on your deck", this, player.Private, player, true, 2, 2);
ChoiceResult replaceResult = player.MakeChoice(replaceChoice);
player.RetrieveCardsFrom(DeckLocation.Private);
player.AddCardsToDeck(replaceResult.Cards, DeckPosition.Top);
}
}
}
示例2: player_GainMandarin
internal void player_GainMandarin(Player player, ref Players.CardGainEventArgs e)
{
CardCollection cardsInPlay = new CardCollection(player.InPlay[Cards.Category.Treasure]);
cardsInPlay.AddRange(player.SetAside[Cards.Category.Treasure]);
Choice replaceChoice = new Choice("Choose order of Treasure cards to put back on your deck", this, cardsInPlay, player, true, cardsInPlay.Count, cardsInPlay.Count);
ChoiceResult replaceResult = player.MakeChoice(replaceChoice);
player.RetrieveCardsFrom(DeckLocation.InPlay, c => replaceResult.Cards.Contains(c));
player.RetrieveCardsFrom(DeckLocation.SetAside, c => replaceResult.Cards.Contains(c));
player.AddCardsToDeck(replaceResult.Cards, DeckPosition.Top);
e.HandledBy.Add(TypeClass.Mandarin);
// 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();
}
示例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);
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);
}
示例5: player_GainInn
internal void player_GainInn(Player player, ref Players.CardGainEventArgs e)
{
CardCollection actionCards = player.DiscardPile.LookThrough(c => (c.Category & Cards.Category.Action) == Cards.Category.Action);
Choice choice = new Choice("Choose cards to reveal and shuffle into your deck", this, actionCards, player, false, 0, actionCards.Count);
ChoiceResult result = player.MakeChoice(choice);
// We lose track of Inn if we put it on top of the deck and shuffle
if (result.Cards.Contains(this))
e.IsLostTrackOf = true;
player.AddCardsInto(DeckLocation.Revealed, player.DiscardPile.Retrieve(player, c => result.Cards.Contains(c)));
player.AddCardsToDeck(player.Revealed.Retrieve(player, c => result.Cards.Contains(c)), DeckPosition.Top);
player.ShuffleDrawPile();
e.HandledBy.Add(TypeClass.Inn);
// 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();
}
示例6: Play
public override void Play(Player player)
{
base.Play(player);
SupplyCollection availableSupplies = new SupplyCollection(player._Game.Table.Supplies.Where(kvp => kvp.Value.Randomizer != null && kvp.Value.Randomizer.GroupMembership != Group.None));
CardCollection cards = new CardCollection();
Choice choice = new Choice("Name a card", this, availableSupplies, player, false);
foreach (Supply supply in player._Game.Table.Supplies.Values.Union(player._Game.Table.SpecialPiles.Values))
{
foreach (Type type in supply.CardTypes)
{
if (!choice.Supplies.Any(kvp => kvp.Value.CardType == type))
cards.Add(Card.CreateInstance(type));
}
}
cards.Sort();
choice.AddCards(cards);
ChoiceResult result = player.MakeChoice(choice);
ICard namedCard = null;
if (result.Supply != null)
namedCard = result.Supply;
else
namedCard = result.Cards[0];
player._Game.SendMessage(player, this, namedCard);
CardCollection newCards = player.Draw(3, DeckLocation.Revealed);
player.Trash(player.RetrieveCardsFrom(DeckLocation.Revealed, c => c.Name == namedCard.Name));
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);
}
示例7: Overpay
public override void Overpay(Player player, Currency amount)
{
Choice choice = new Choice("Choose cards to put on top of your deck", this, player.DiscardPile.LookThrough(c => true), player, false, amount.Coin.Value, amount.Coin.Value);
ChoiceResult result = player.MakeChoice(choice);
player.AddCardsInto(DeckLocation.Revealed, player.DiscardPile.Retrieve(player, c => result.Cards.Contains(c)));
player.AddCardsToDeck(player.Revealed.Retrieve(player, c => result.Cards.Contains(c)), DeckPosition.Top);
}
示例8: 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
}
示例9: 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);
}
示例10: Play
public override void Play(Player player)
{
base.Play(player);
CardCollection newCards = player.Draw(4, DeckLocation.Revealed);
player.AddCardsToHand(player.RetrieveCardsFrom(DeckLocation.Revealed,
c => c.CardType == Universal.TypeClass.Copper || c.CardType == Alchemy.TypeClass.Potion));
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);
}