Example #1
0
 @Override
 public boolean isOpen() {
   // Weekday
   if (CityClock.getDay() != 0 && CityClock.getDay() != 6) {
     if (CityClock.getTime() > weekdayOpen && CityClock.getTime() < weekdayClose) {
       if (host.checkWorkStatus() && cashier.checkWorkStatus() && cook.checkWorkStatus()) {
         if (waiter.checkWorkStatus()
             || sharedDataWaiter.checkWorkStatus()
             || waiter2.checkWorkStatus()
             || sharedDataWaiter2.checkWorkStatus()) {
           return true;
         }
       }
     }
   }
   // weekend
   else {
     if (CityClock.getTime() > weekendOpen && CityClock.getTime() < weekendClose) {
       if (host.checkWorkStatus() && cashier.checkWorkStatus() && cook.checkWorkStatus()) {
         if (waiter.checkWorkStatus()
             || sharedDataWaiter.checkWorkStatus()
             || waiter2.checkWorkStatus()
             || sharedDataWaiter2.checkWorkStatus()) {
           return true;
         }
       }
     }
   }
   return false;
 }