Advertisement
UberMouse

Untitled

Jul 24th, 2011
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.24 KB | None | 0 0
  1. public static boolean doBanking(BankItem... bis) {
  2.         if (!Bank.isOpen())
  3.             Bank.open();
  4.         UberBanking.depositAllExcept(bis);
  5.         for (BankItem bi : bis) {
  6.             if ((!UberInventory.contains(bi.getId()) && !UberInventory.contains(bi.getName())) || bi.inventoryCount() != bi.getQuantity()) {
  7.                 if (bi.getId() != -1)
  8.                     UberBanking.makeInventoryCount(bi.getId(), bi.getQuantity());
  9.                 else
  10.                     UberBanking.makeInventoryCount(bi.getName(), bi.getQuantity());
  11.             }
  12.         }
  13.         boolean close = true;
  14.         for (BankItem bi : bis) {
  15.             if (bi.getId() != -1) {
  16.                 if (!UberInventory.contains(bi.getId()))
  17.                     close = false;
  18.             }
  19.             else if (!UberInventory.contains(bi.getName()))
  20.                 close = false;
  21.             if(bi.inventoryCount() != bi.getQuantity())
  22.                 close = false;
  23.         }
  24.         int count = 0;
  25.         for(BankItem bi : bis)
  26.          count += bi.getQuantity();
  27.         if (Inventory.getCount(true) != count)
  28.             close = false;
  29.         if (close) {
  30.             Bank.close();
  31.             return true;
  32.         }
  33.         return false;
  34.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement