Exemplo n.º 1
0
 @Override
 public EconomyResponse bankDeposit(String name, double amount) {
   if (!economy.bankExists(name)) {
     return new EconomyResponse(amount, 0, ResponseType.FAILURE, "That bank does not exist!");
   } else {
     economy.addBankMoney(name, (int) amount, true);
     return new EconomyResponse(
         (int) amount, economy.getBankMoney(name), ResponseType.SUCCESS, "");
   }
 }
Exemplo n.º 2
0
 @Override
 public EconomyResponse bankWithdraw(String name, double amount) {
   EconomyResponse er = bankHas(name, amount);
   if (!er.transactionSuccess()) {
     return er;
   } else {
     economy.addBankMoney(name, (int) -amount, true);
     return new EconomyResponse(
         (int) amount, economy.getBankMoney(name), ResponseType.SUCCESS, "");
   }
 }