本文整理汇总了C#中Dominion.Card.getBuy方法的典型用法代码示例。如果您正苦于以下问题:C# Card.getBuy方法的具体用法?C# Card.getBuy怎么用?C# Card.getBuy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dominion.Card
的用法示例。
在下文中一共展示了Card.getBuy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: testGetBuy
public void testGetBuy()
{
Card test = new Card(0, 0, 0, 0, 0, 0, 0, "Null Card", "Null Card", 0, "Null");
Assert.AreEqual(0, test.getBuy());
test = new Card(1, 0, 1, 0, 0, 0, 0, "Null Card", "Null Card", 0, "Null");
Assert.AreEqual(1, test.getBuy());
test = new Card(5, 0, 99, 0, 0, 0, 0, "Null Card", "Null Card", 0, "Null");
Assert.AreEqual(99, test.getBuy());
}
示例2: play
public StatusObject play(Card aCard)
{
StatusObject retVal = new StatusObject(false);
if (this.myHand.contains(aCard) && aCard.getPlayable() && this.actionsLeft > 0)
{
this.actionsLeft--;
this.played.Add(this.myHand.remove(aCard));
this.timesToPlayLeft = this.timesToPlayNextCard;
this.timesPlayed.Add(this.timesToPlayLeft);
this.timesToPlayNextCard = 1; // we just set it to use up those plays.
this.lastPlayedCard = aCard;
if (this.game != null)
{
this.game.addToGameMessage(this.name + Internationalizer.getMessage("Played") + aCard.getName());
}
if (timesToPlayLeft > 1)
{
this.playMultipleTimes = false;
}
while (this.timesToPlayLeft > 0)
{
this.timesToPlayLeft--;
switch (aCard.getFunctionNumber())
{
case 0:
//No Action
break;
case 1:
//Draw only
retVal.setMessage(Internationalizer.getMessage("DrawMsg"));
CardFunctions.draw(this, aCard.getAdditionalDraws());
break;
case 2:
//Draw and Add Actions.
retVal.setMessage(Internationalizer.getMessage("DrawActionMsg"));
CardFunctions.draw(this, aCard.getAdditionalDraws());
CardFunctions.actionAdd(this, aCard.getActions());
break;
case 3:
//Draw and Add and Buy
retVal.setMessage(Internationalizer.getMessage("DrawActionBuyMsg"));
CardFunctions.draw(this, aCard.getAdditionalDraws());
CardFunctions.actionAdd(this, aCard.getActions());
CardFunctions.buyAdd(this, aCard.getBuy());
break;
case 4:
//Add buy
retVal.setMessage(Internationalizer.getMessage("BuyMsg"));
CardFunctions.buyAdd(this, aCard.getBuy());
break;
case 5:
//Add actions and draw
retVal.setMessage(Internationalizer.getMessage("DrawActionMsg"));
CardFunctions.draw(this, aCard.getAdditionalDraws());
CardFunctions.actionAdd(this, aCard.getActions());
break;
case 6:
//Add actions and buy
retVal.setMessage(Internationalizer.getMessage("ActionBuyMsg"));
CardFunctions.actionAdd(this, aCard.getActions());
CardFunctions.buyAdd(this, aCard.getBuy());
break;
case 7:
//add cards and gain curses.
retVal.setMessage(Internationalizer.getMessage("WitchMsg"));
CardFunctions.draw(this, aCard.getAdditionalDraws());
CardFunctions.gainCurses(this);
break;
case 8:
//Remodel a card, trash and gain
retVal.setMessage(Internationalizer.getMessage("RemodelMsg"));
CardFunctions.gainCardRemodel(this, retVal);
break;
case 9:
//Feast, trash and gain
retVal.setMessage(Internationalizer.getMessage("FeastMsg"));
CardFunctions.gainCardFeast(this, retVal);
break;
case 10:
//Workshop, gain card worth 4
retVal.setMessage(Internationalizer.getMessage("WorkshopMsg"));
CardFunctions.gainCardWorkshop(this, retVal);
break;
case 11:
//Throne Room. Double the number of next plays.
retVal.setMessage(Internationalizer.getMessage("ThroneRoomMsg"));
CardFunctions.doubleNextPlay(this, this.timesToPlayLeft + 1);
this.timesToPlayLeft = 0;
CardFunctions.actionAdd(this, aCard.getActions());
break;
case 12:
//Cellar
retVal.setMessage(Internationalizer.getMessage("CellarMsg"));
CardFunctions.actionAdd(this, aCard.getActions());
CardFunctions.setupDiscardCardsToDrawSameNumber(this, retVal);
break;
case 13:
//MoneyLender
retVal.setMessage(Internationalizer.getMessage("MoneylenderMsg"));
CardFunctions.addNeededTrashes(this, retVal);
//.........这里部分代码省略.........