예제 #1
0
 public void Do_purge()
 {
     if (REG.usedSpace > 0)
     {
         REG.Dump_line();
     }
     else if (L1.usedSpace > 0)
     {
         Factory.INSTANCE.L3.Await_purged_data();
         L1.Dump_first_line_with_data();
     }
     else if (L2.usedSpace > 0)
     {
         Factory.INSTANCE.L3.Await_purged_data();
         L2.Dump_first_line_with_data();
         if (L2.usedSpace == 0)
         {
             // purge complete
             // reset all workshops - start searching fresh for parts
             foreach (var _WORKSHOP in Factory.INSTANCE.workshops)
             {
                 _WORKSHOP.Clear_all_requests_then_idle();
             }
         }
     }
     if (REG.currentState == StorageState.IDLE &&
         L1.currentState == StorageState.IDLE &&
         L2.currentState == StorageState.IDLE
         )
     {
         Cancel_purge();
     }
 }