当前位置: 首页>>代码示例>>C#>>正文


C# Card.getPlayable方法代码示例

本文整理汇总了C#中Dominion.Card.getPlayable方法的典型用法代码示例。如果您正苦于以下问题:C# Card.getPlayable方法的具体用法?C# Card.getPlayable怎么用?C# Card.getPlayable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Dominion.Card的用法示例。


在下文中一共展示了Card.getPlayable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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);
//.........这里部分代码省略.........
开发者ID:postcn,项目名称:Dominion,代码行数:101,代码来源:Player.cs


注:本文中的Dominion.Card.getPlayable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。