本文整理汇总了C#中DominionBase.Players.Player.RemoveTokens方法的典型用法代码示例。如果您正苦于以下问题:C# Player.RemoveTokens方法的具体用法?C# Player.RemoveTokens怎么用?C# Player.RemoveTokens使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DominionBase.Players.Player
的用法示例。
在下文中一共展示了Player.RemoveTokens方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Play
public override void Play(Player player)
{
base.Play(player);
player.AddToken(new CoinToken());
player.AddToken(new CoinToken());
Choice choiceTrash = new Choice("You may choose a card to trash", this, player.Hand, player, false, 0, 1);
ChoiceResult resultTrash = player.MakeChoice(choiceTrash);
if (resultTrash.Cards.Count > 0)
{
player.Trash(player.RetrieveCardsFrom(DeckLocation.Hand, resultTrash.Cards));
List<String> options = new List<string>();
for (int i = 0; i <= player.TokenPiles[TypeClass.CoinToken].Count; i++)
options.Add(i.ToString());
Choice choiceOverpay = new Choice("You may pay any number of Coin tokens", this, new CardCollection() { this }, options, player);
ChoiceResult resultOverpay = player.MakeChoice(choiceOverpay);
int overpayAmount = int.Parse(resultOverpay.Options[0]);
player._Game.SendMessage(player, this, overpayAmount);
player.RemoveTokens(TypeClass.CoinToken, overpayAmount);
Cost trashedCardCost = player._Game.ComputeCost(resultTrash.Cards[0]);
SupplyCollection gainableSupplies = player._Game.Table.Supplies.FindAll(supply => supply.CanGain() && supply.CurrentCost <= (trashedCardCost + new Coin(overpayAmount)));
Choice choice = new Choice("Gain a card", this, gainableSupplies, player, false);
ChoiceResult result = player.MakeChoice(choice);
if (result.Supply != null)
player.Gain(result.Supply);
}
}