コード例 #1
0
 /** Scheduler. Determine what action is called for, and do it. */
 public boolean pickAndExecuteAnAction() {
   if (state == State.rcvdPayment) {
     for (int i = 0; i < marketBills.size(); i++) {
       Bill b = marketBills.get(i);
       if (b.cust == customer) {
         ProcessPayment(b, amt);
         UpdateInventory(b);
         return true;
       }
     }
   }
   //		print("no customers left: "+market.noCustomers());
   //		print("shiftdone? "+shiftDone);
   if (shiftDone) {
     if (market.noCustomers()) {
       ShiftDone();
       shiftDone = false;
     }
     return true;
   }
   if (state == State.left) {
     StopWork();
     return true;
   }
   return false;
 }
コード例 #2
0
 public void StopWork() {
   state = State.idle;
   person.msgStopWork(wage);
   market.removeMe(this);
 }
コード例 #3
0
ファイル: BankMap.java プロジェクト: Rambrant/Billing
 public Bank getBank(Market market) {
   return bankByMarketMap.get(market.getOrganizationId());
 }