本文整理汇总了C#中Dominion.Card.getCost方法的典型用法代码示例。如果您正苦于以下问题:C# Card.getCost方法的具体用法?C# Card.getCost怎么用?C# Card.getCost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dominion.Card
的用法示例。
在下文中一共展示了Card.getCost方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: testGetCost
public void testGetCost()
{
Card test = new Card(0, 0, 0, 0, 0, 0, 0, "Null Card", "Null Card", 0, "Null");
Assert.AreEqual(0, test.getCost());
test = new Card(0, 0, 0, 0, 1, 0, 1, "Null Card", "Null Card", 1, "Null");
Assert.AreEqual(1, test.getCost());
test = new Card(3, 0, 2, 0, 99, 4, 99, "Null Card", "Null Card", 99, "Null");
Assert.AreEqual(99, test.getCost());
}
示例2: trashForGain
public StatusObject trashForGain(Card c)
{
StatusObject o = new StatusObject(false);
if (this.myHand.getHand().Count == 0)
{
o.setTrashedCorrectly(true);
this.currencyForGainBonus = 0;
this.gainsLeft = 0;
}
if (this.gain)
{
//check if card is in hand or if its feast (which has already been played)
if (this.myHand.contains(c))
{
this.myHand.remove(c);//don't put it anywhere so trashed
this.currencyForGain = c.getCost() + this.currencyForGainBonus;
if (this.gainsLeft <= 0)
{
this.currencyForGainBonus = 0;
}
o.setTrashedCorrectly(true);
}
}
return o;
}