@@ -0,0 +1,1938 @@
+package cs201.roles.bankRoles;%0A%0Aimport java.awt.List;%0Aimport java.util.Queue;%0A%0A%0Apublic class BankGuardRole extends Role implements BankGuard %7B%0A%09%0A%09//================================================================================%0A    // Member Variables%0A    //================================================================================%0A%09%0A%09Queue%3CBankCustomerRole%3E waitingCustomers;%0A%09List%3CBankTellerRole%3E bankTellers;%0A%09%0A%09//================================================================================%0A    // Scheduler%0A    //================================================================================%0A%09%0A%09public boolean pickAndExecuteAnAction() %7B%0A%09%09if (%C6%8E BankCustomerRole cust in waitingCustomers && %0A%09%09%09%09%C6%8E BankTellerRole teller in bankTellers %E2%88%8B teller.state == TellerState.UNOCCUPIED) %7B%0A%09%09%09    escortToTeller(cust, teller);%0A%09%09%7D%0A%09%09if (!Bank.getOpen) %7B // May not need this rule if we just allow customers to finish up%0A%09%09%09    escortCustomersOut();%0A%09%09%7D%0A        return false;%0A%09%7D%0A%09%0A%09//================================================================================%0A    // Messages%0A    //================================================================================%0A%09%0A%09public void msgHereToSeeTeller(BankCustomerRole customer) %7B%0A%09    // Add customer to queue%0A%09    waitingCustomers.add(customer);%0A%09    stateChanged();%0A%09%7D%0A%09%0A%09public void msgDoneWithCustomer(BankTellerRole teller) %7B%0A%09    stateChanged();%0A%09%7D%0A%09%0A%09//================================================================================%0A    // Actions%0A    //================================================================================%0A%0A%09private void escortToTeller(cust, teller) %7B%0A%09    waitingCustomers.peek().msgGoToTeller(teller);%0A%09    waitingCustomers.remove();%0A%09%7D%0A%09%0A%09private void escortCustomersOut(cust, teller) %7B%0A%09    for (BankCustomerRole cust : waitingCustomers) %7B%0A%09        waitingCustomers.peek().msgLeaveBank(cust);%0A%09        waitingCustomers.remove();%0A%09    %7D%0A%09%7D%0A%7D%0A

Create BankGuardRole stub