コード例 #1
0
 @Override
 public void play(LogHandler logHandler) {
   owner.drawCards(3);
   for (DomPlayer thePlayer : owner.getOpponents()) {
     if (thePlayer.checkDefense()) continue;
     ArrayList<DomCard> theTopThree = thePlayer.revealTopCards(3);
     for (DomCard theCard : theTopThree) {
       if (theCard.hasCardType(DomCardType.Treasure) || theCard.hasCardType(DomCardType.Action)) {
         thePlayer.discard(theCard);
       } else {
         thePlayer.putOnTopOfDeck(theCard);
       }
     }
   }
 }
コード例 #2
0
 private void handleOpponents(LogHandler logHandler) {
   for (DomPlayer thePlayer : owner.getOpponents()) {
     boolean trashes = false;
     if (thePlayer.getCardsInHand().size() > 0) {
       Collections.sort(thePlayer.getCardsInHand(), SORT_FOR_TRASHING);
       DomCard theCardToTrash = thePlayer.getCardsInHand().get(0);
       if (theCardToTrash.getTrashPriority() < 16) {
         if (!thePlayer.removingReducesBuyingPower(theCardToTrash)) {
           thePlayer.trash(thePlayer.removeCardFromHand(theCardToTrash));
           trashes = true;
         }
       }
     }
     if (logHandler.getHaveToLog() && !trashes)
       logHandler.addToLog(thePlayer + " trashes nothing");
   }
 }