예제 #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, "");
   }
 }
예제 #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, "");
   }
 }