本文整理汇总了C#中DominionBase.Players.Player.RetrieveCardFrom方法的典型用法代码示例。如果您正苦于以下问题:C# Player.RetrieveCardFrom方法的具体用法?C# Player.RetrieveCardFrom怎么用?C# Player.RetrieveCardFrom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DominionBase.Players.Player
的用法示例。
在下文中一共展示了Player.RetrieveCardFrom方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: player_Action
internal void player_Action(Player player, ref CardsDiscardEventArgs e)
{
e.Cards.Remove(this.PhysicalCard);
Card thisCard = null;
if (player.InPlay.Contains(this.PhysicalCard))
thisCard = player.RetrieveCardFrom(DeckLocation.InPlay, this.PhysicalCard);
else
thisCard = player.RetrieveCardFrom(DeckLocation.SetAside, this.PhysicalCard);
player.AddCardToDeck(thisCard, DeckPosition.Top);
}
示例2: 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);
}
}
}
示例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();
}
示例4: 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);
}
示例5: PlayDuration
public override void PlayDuration(Player player)
{
base.PlayDuration(player);
player.ReceiveBenefit(this, new CardBenefit() { Cards = 1 });
player.AddCardToHand(player.RetrieveCardFrom(DeckLocation.SetAside, this));
}
示例6: 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);
}
}
}
}
示例7: Play
public override void Play(Player player)
{
base.Play(player);
while (player.Hand.Count < 7 && player.CanDraw)
{
Card card = player.Draw(DeckLocation.Private);
if ((card.Category & Category.Action) == Category.Action)
{
Choice choice = Choice.CreateYesNoChoice(String.Format("Would you like to set aside {0}?", card.Name), this, card, player, null);
ChoiceResult result = player.MakeChoice(choice);
if (result.Options[0] == "Yes")
{
player.AddCardInto(DeckLocation.Revealed, player.RetrieveCardFrom(DeckLocation.Private, card));
}
else if (result.Options[0] == "No")
{
player.AddCardToHand(player.RetrieveCardFrom(DeckLocation.Private, card));
}
}
else
{
player.AddCardToHand(player.RetrieveCardFrom(DeckLocation.Private, card));
}
}
player.DiscardRevealed();
}
示例8: player_FoolsGold
internal void player_FoolsGold(Player player, ref Players.CardGainEventArgs e)
{
if (player.Hand.Contains(this.PhysicalCard))
{
player.AddCardInto(DeckLocation.Revealed, player.RetrieveCardFrom(DeckLocation.Hand, this.PhysicalCard));
player.Trash(player.RetrieveCardFrom(DeckLocation.Revealed, this.PhysicalCard));
player.Gain(player._Game.Table.Gold, DeckLocation.Deck, DeckPosition.Top);
e.HandledBy.Add(TypeClass.FoolsGold);
}
}
示例9: 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;
}
示例10: player_RevealTrader
internal void player_RevealTrader(Player player, ref Players.CardGainEventArgs e)
{
player.AddCardInto(DeckLocation.Revealed, player.RetrieveCardFrom(DeckLocation.Hand, this));
player.AddCardInto(DeckLocation.Hand, player.RetrieveCardFrom(DeckLocation.Revealed, this));
// Cancel the gain, add the card back to the Supply pile, and then Gain a Silver instead.
e.Cancelled = true;
e.IsLostTrackOf = true;
//player._Game.Table.Supplies[e.Card].AddTo(e.Card);
player._Game.SendMessage(player, this, e.Card, player._Game.Table.Silver);
player.Gain(player._Game.Table.Silver);
}
示例11: player_DiscardTunnel
internal void player_DiscardTunnel(Player player, ref CardsDiscardEventArgs e)
{
player.AddCardInto(DeckLocation.Revealed, this);
player.RetrieveCardFrom(DeckLocation.Revealed, this);
player.Gain(player._Game.Table.Gold);
e.HandledBy.Add(this);
}
示例12: Play
public override void Play(Player player)
{
base.Play(player);
Choice choice = new Choice("You may choose a Treasure card to trash", this, player.Hand[Cards.Category.Treasure], player, false, 0, 1);
ChoiceResult result = player.MakeChoice(choice);
if (result.Cards.Count > 0)
{
player.Trash(player.RetrieveCardFrom(DeckLocation.Hand, result.Cards[0]));
CardBenefit benefit = new CardBenefit();
Choice choiceBenefit = new Choice("Choose either +2 Cards and +1 Action; or +<coin>2</coin> and +1 Buy", this, new CardCollection() { this }, new List<string>() { "+2<nbsp/>Cards and +1<nbsp/>Action", "+<coin>2</coin> and +1<nbsp/>Buy" }, player);
ChoiceResult resultBenefit = player.MakeChoice(choiceBenefit);
if (resultBenefit.Options[0] == "+2<nbsp/>Cards and +1<nbsp/>Action")
{
benefit.Cards = 2;
benefit.Actions = 1;
}
else
{
benefit.Currency.Coin.Value = 2;
benefit.Buys = 1;
}
player.ReceiveBenefit(this, benefit);
}
}
示例13: player_DiscardAction
internal void player_DiscardAction(Player player, ref CardsDiscardEventArgs e)
{
Card cardToTopDeck = e.Data as Card;
e.Cards.Remove(cardToTopDeck);
if (player.InPlay.Contains(cardToTopDeck))
player.RetrieveCardFrom(DeckLocation.InPlay, cardToTopDeck);
else
player.RetrieveCardFrom(DeckLocation.SetAside, cardToTopDeck);
player.AddCardToDeck(cardToTopDeck, DeckPosition.Top);
e.HandledBy.Add(cardToTopDeck);
}
示例14: 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();
}
示例15: player_TrashHovel
internal void player_TrashHovel(Player player, ref Players.CardBuyEventArgs e)
{
player.Trash(player.RetrieveCardFrom(DeckLocation.Hand, this.PhysicalCard));
e.HandledBy.Add(this);
}