private void bank() throws Exception { if (Bank.open()) System.out.println("opened bank"); else { sleep(Times.SHORT); Bank.open(); } sleep(Times.SHORT); Bank.depositInventory(); sleep(Times.SHORT); Bank.close(); sleep(Times.BANK); }
@Override public void execute() { if (Bank.isOpen()) { if (containsLoot(Ids.ALL_ITEMS)) { Log.log("depositing", "Clearing Inventory for new trip."); Bank.depositInventory(); } if (finished()) { Log.log("banking", "Completed inventory. Attempting to close."); Bank.close(); } else withdrawInventory(); } else { Log.log("banking", "Opening bank."); Bank.open(); } }