Beispiel #1
0
 @Override
 public boolean choose(Outcome outcome, Cards cards, TargetCard target, Game game) {
   if (cards.isEmpty()) return !target.isRequired();
   Set<UUID> possibleTargets = target.possibleTargets(playerId, cards, game);
   if (possibleTargets.isEmpty()) return !target.isRequired();
   Iterator<UUID> it = possibleTargets.iterator();
   int targetNum = rnd.nextInt(possibleTargets.size());
   UUID targetId = it.next();
   for (int i = 0; i < targetNum; i++) {
     targetId = it.next();
   }
   target.add(targetId, game);
   return true;
 }
 @Override
 public boolean choose(Outcome outcome, Cards cards, TargetCard target, Game game) {
   if (this.isHuman()) {
     if (cards.isEmpty()) {
       return false;
     }
     Set<UUID> possibleTargets = target.possibleTargets(playerId, cards, game);
     if (possibleTargets.isEmpty()) {
       return false;
     }
     Iterator<UUID> it = possibleTargets.iterator();
     int targetNum = rnd.nextInt(possibleTargets.size());
     UUID targetId = it.next();
     for (int i = 0; i < targetNum; i++) {
       targetId = it.next();
     }
     target.add(targetId, game);
     return true;
   }
   return super.choose(outcome, cards, target, game);
 }