Examples of pay()


Examples of br.com.caelum.restbucks.model.Order.pay()

        System.out.println(String.format("Order placed at [%s]", order.getSelfUri()));
       
        // Pay for the order
        Payment payment = new Payment("12345677878", "guilherme silveira", 12, 2999, order.getCost());
        System.out.println(String.format("About to create a payment resource at [%s] via PUT", resource(order).getRelation("payment").getHref()));
        payment =  order.pay(payment);
        System.out.println("Payment made, receipt created at: " + payment.getCreatedAt());

        // Check on the order status
        System.out.println(String.format("About to check order status at [%s] via GET", order.getSelfUri()));
        order = (Order) resource(order).getRelation("self").accessAndRetrieve();
View Full Code Here

Examples of com.palmergames.bukkit.towny.object.Nation.pay()

            throw new TownyException(TownySettings.getLangString("msg_neutral_disabled"));

          boolean choice = !nation.isNeutral();
          Double cost = TownySettings.getNationNeutralityCost();

          if (choice && TownySettings.isUsingEconomy() && !nation.pay(cost, "Nation Neutrality Cost"))
            throw new TownyException(TownySettings.getLangString("msg_nation_cant_neutral"));

          nation.setNeutral(choice);
          plugin.updateCache();
View Full Code Here

Examples of com.palmergames.bukkit.towny.object.Resident.pay()

                       
                        if (TownySettings.getMaxDistanceBetweenHomeblocks() > 0)
                                if ((world.getMinDistanceFromOtherTowns(key) > TownySettings.getMaxDistanceBetweenHomeblocks()) && world.hasTowns())
                                        throw new TownyException(TownySettings.getLangString("msg_too_far"));

                        if (TownySettings.isUsingEconomy() && !resident.pay(TownySettings.getNewTownPrice(), "New Town Cost"))
                                throw new TownyException(String.format(TownySettings.getLangString("msg_no_funds_new_town"), (resident.getName().equals(player.getName()) ? "You" : resident.getName())));

                        newTown(universe, world, name, resident, key, player.getLocation());                   
                        TownyMessaging.sendGlobalMessage(TownySettings.getNewTownMsg(player.getName(), name));
                } catch (TownyException x) {
View Full Code Here

Examples of com.palmergames.bukkit.towny.object.Town.pay()

        throw new TownyException(TownySettings.getLangString("msg_err_already_nation"));

      if (!TownySettings.isValidRegionName(name))
        throw new TownyException(String.format(TownySettings.getLangString("msg_err_invalid_name"), name));

      if (TownySettings.isUsingEconomy() && !town.pay(TownySettings.getNewNationPrice(), "New Nation Cost"))
        throw new TownyException(TownySettings.getLangString("msg_no_funds_new_nation"));

      newNation(universe, name, town);
      /*universe.newNation(name);
      Nation nation = universe.getNation(name);
View Full Code Here

Examples of mage.abilities.costs.Cost.pay()

        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            Cost cost = new ManaCostsImpl("{8}");
            if (player.chooseUse(Outcome.Tap, "Pay " + cost.getText() + " and " + staticText, game)) {
                cost.clearPaid();
                if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
                    for (UUID target : this.targetPointer.getTargets(game, source)) {
                        Permanent permanent = game.getPermanent(target);
                        if (permanent != null) {
                            permanent.tap(game);
                            ContinuousEffect effect = new SkipNextUntapTargetEffect();
View Full Code Here

Examples of mage.abilities.costs.Cost.pay()

                    Permanent permanent = game.getPermanent(card.getId());
                    if (permanent != null) {
                        permanent.addCounters(CounterType.LUCK.createInstance(), game);
                        Cost cost = new ExileFromHandCost(new TargetCardInHand());
                        if (cost.canPay(source, source.getSourceId(), source.getControllerId(), game)) {
                            cost.pay(source, game, source.getSourceId(), source.getControllerId(), true);
                        }
                    }
                }
            }
        }
View Full Code Here

Examples of mage.abilities.costs.Cost.pay()

        Player player = game.getPlayer(source.getControllerId());
        Permanent permanent = game.getPermanent(source.getSourceId());
        if (player != null && permanent != null) {
            if (player.chooseUse(Outcome.Damage, new StringBuilder("Extort opponents? (").append(permanent.getName()).append(")").toString(), game)) {
                Cost cost = new ManaCostsImpl("{W/B}");
                if (cost.pay(source, game, source.getSourceId(), player.getId(), false)) {
                    int loseLife = 0;
                    for (UUID opponentId : game.getOpponents(source.getControllerId())) {
                        loseLife += game.getPlayer(opponentId).loseLife(1, game);
                    }
                    if (loseLife > 0) {
View Full Code Here

Examples of mage.abilities.costs.Cost.pay()

                    message = "Would you like to pay " + costToPay.getText() + " to prevent counter effect?";
                } else {
                    message = costToPay.getText() + " to prevent counter effect?";
                }
                costToPay.clearPaid();
                if (!(player.chooseUse(Outcome.Benefit, message, game) && costToPay.pay(source, game, spell.getSourceId(), spell.getControllerId(), false))) {
                    return game.getStack().counter(spell.getId(), source.getSourceId(), game);
                }
                return true;
            }
        }
View Full Code Here

Examples of mage.abilities.costs.Cost.pay()

    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(targetPointer.getFirst(game, source));
        if (player != null) {
            Cost cost = new DiscardTargetCost(new TargetCardInHand());
            if (cost.canPay(source, player.getId(), player.getId(), game)) {
                if (!cost.pay(source, game, player.getId(), player.getId(), false)) {
                    player.loseLife(5, game);
                }
                return true;
            }
        }
View Full Code Here

Examples of mage.abilities.costs.Cost.pay()

    @Override
    public boolean apply(Game game, Ability source) {
        Cost cost = new GenericManaCost(1);
        cost.clearPaid();
        if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
            new MyrToken().putOntoBattlefield(1, game, source.getControllerId(), source.getControllerId());
        }
        return true;
    }
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.