Examples of canAfford()


Examples of com.bekvon.bukkit.residence.economy.EconomyInterface.canAfford()

            ClaimedResidence res = manager.getByName(area);
            int amount = (int) Math.ceil((double)res.getTotalSize() * cost);
            if(cost!=0D)
            {
                //Account account = iConomy.getBank().getAccount(player.getName());
                if(econ.canAfford(player.getName(), amount)/*account.hasEnough(amount)*/)
                {
                    econ.subtract(player.getName(), amount);
                    econ.add("Lease Money", amount);
                    player.sendMessage(ChatColor.GREEN+Residence.getLanguage().getPhrase("MoneyCharged",ChatColor.YELLOW + String.format("%d",amount)+ChatColor.GREEN+"."+ChatColor.YELLOW + econ.getName() + ChatColor.GREEN));
                }
View Full Code Here

Examples of pl.com.bottega.ecommerce.sales.domain.client.Client.canAfford()

      throw new OfferChangedExcpetion(reservation.getAggregateId(), seenOffer, newOffer);
   
    Client client = loadClient();//create per logged client, not reservation owner         
    Purchase purchase = purchaseFactory.create(reservation.getAggregateId(), client, seenOffer);
       
    if (! client.canAfford(purchase.getTotalCost()))
      throw new DomainOperationException(client.getAggregateId(), "client has insufficent money");
   
    purchaseRepository.save(purchase);//Aggregate must be managed by persistence context before firing events (synchronous listeners may need to load it)
   
    /*
 
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.