Esempio n. 1
0
 public void withdrawMoneyWithBalanceCheck(
     TaxPayer payer, double amount, FinancialCallback callback) {
   new Thread(
           () -> {
             if (payer.withdrawMoney(amount)) {
               if (callback != null) callback.done(payer.getMoney(), amount);
             } else {
               if (callback != null) callback.done(payer.getMoney(), 0);
             }
           })
       .start();
 }
Esempio n. 2
0
 public void giveMoney(UUID player, double amount, FinancialCallback callback) {
   new Thread(
           () -> {
             PlayerData data = getData(player);
             data.creditMoney(amount);
             if (callback != null) callback.done(data.getMoney(), amount);
           })
       .start();
 }