Examples of chooseTarget()


Examples of mage.players.Player.chooseTarget()

    private UUID getOpponentId(UUID playerId, Ability source, Game game) {
        if (opponentId == null) {
            TargetOpponent target = new TargetOpponent();
            Player player = game.getPlayer(playerId);
            if (player != null) {
                if (player.chooseTarget(Outcome.Detriment, target, source, game)) {
                    opponentId = target.getFirstTarget();
                }
            }
        }
        return opponentId;
View Full Code Here

Examples of mage.players.Player.chooseTarget()

                    this.addTarget(((UUID) it.next()), source, game);
                } else {
                    return chosen;
                }
            } else {
                if (!player.chooseTarget(outcome, this, source, game)) {
                    return chosen;
                }
            }
            chosen = targets.size() >= minNumberOfTargets;
        }
View Full Code Here

Examples of mage.target.Target.chooseTarget()

                            game.informPlayer(player, "You may only select exactly one target that must be different from the origin target!");
                        }
                        iteration++;
                        newTarget.clearChosen();
                        // TODO: Distinction between "spell controller" and "player that can change the target" - here player is used for both
                        newTarget.chooseTarget(mode.getEffects().get(0).getOutcome(), player.getId(), spellAbility, game);
                    } while (player.isInGame() && (targetId.equals(newTarget.getFirstTarget()) || newTarget.getTargets().size() != 1));
                // choose a new target
                } else {
                    // build a target definition with exactly one possible target to select that replaces old target
                    Target tempTarget = target.copy();
View Full Code Here

Examples of mage.target.Target.chooseTarget()

                    tempTarget.setMaxNumberOftargets(1);
                    boolean again;
                    do {
                        again = false;
                        tempTarget.clearChosen();
                        if (!tempTarget.chooseTarget(mode.getEffects().get(0).getOutcome(), player.getId(), spellAbility, game)) {
                            if (player.chooseUse(Outcome.Benefit, "No target object selected. Reset to original target?", game)) {
                                // use previous target no target was selected
                                newTarget.addTarget(targetId, target.getTargetAmount(targetId), spellAbility, game, false);
                            } else {
                                again = true;
View Full Code Here

Examples of mage.target.common.TargetCardInHand.chooseTarget()

                        firstInactivePlayer = currentPlayer.getId();
                    }
                    target.clearChosen();
                    if (target.canChoose(source.getSourceId(), currentPlayer.getId(), game)
                            && currentPlayer.chooseUse(outcome, "Put permanent from your hand to play?", game)) {
                        if (target.chooseTarget(outcome, currentPlayer.getId(), source, game)) {
                            Card card = game.getCard(target.getFirstTarget());
                            if (card != null) {
                                currentPlayer.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
                                firstInactivePlayer = null;
                            }
View Full Code Here

Examples of org.jboss.ha.client.loadbalance.LoadBalancePolicy.chooseTarget()

      {
         target = (InvokerLocator) ((AopLoadBalancePolicy) lb).chooseTarget(family.get(), invocation);
      }
      else
      {
         target = (InvokerLocator) lb.chooseTarget(family.get());
      }
     
      Throwable lastException = null;
      while (target != null)
      {
View Full Code Here

Examples of org.jboss.ha.client.loadbalance.LoadBalancePolicy.chooseTarget()

         if (!definitivlyRemoveNodeOnFailure)
         {
            family.get().resetView();
         }

         target = (InvokerLocator) lb.chooseTarget(family.get());
         if (target == null)
         {
            if (lastException != null)
            {
               throw new RuntimeException("cluster invocation failed, last exception was: ", lastException);
View Full Code Here

Examples of org.jboss.ha.client.loadbalance.LoadBalancePolicy.chooseTarget()

      {
         target = (InvokerLocator) ((AopLoadBalancePolicy) lb).chooseTarget(family.get(), invocation);
      }
      else
      {
         target = (InvokerLocator) lb.chooseTarget(family.get());
      }
     
      Throwable lastException = null;
      while (target != null)
      {
View Full Code Here

Examples of org.jboss.ha.client.loadbalance.LoadBalancePolicy.chooseTarget()

         if (!definitivlyRemoveNodeOnFailure)
         {
            family.get().resetView();
         }

         target = (InvokerLocator) lb.chooseTarget(family.get());
         if (target == null)
         {
            if (lastException != null)
            {
               throw new RuntimeException("cluster invocation failed, last exception was: ", lastException);
View Full Code Here

Examples of org.jboss.ha.client.loadbalance.LoadBalancePolicy.chooseTarget()

   {
      testCount++;
      FamilyClusterInfo fci = ClusteringTargetsRepository.initTarget(FAMILY_BASE + testCount, Arrays.asList(TARGETS));
     
      LoadBalancePolicy lbp = getLoadBalancePolicy();
      Object target = lbp.chooseTarget(fci);
     
      for (int i = 0; i < 10000; i++)
      {
         assertSame(target, getLoadBalancePolicy().chooseTarget(fci));
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.