コード例 #1
0
 //------------------------------------------------------------------------------
 // WARNING!!! - This function can overwrite information. PLEASE READ
 //
 // This makes the list of classes available over successive years. Current data
 // being used is for the duration of one year, therefore this function sets up
 // the machineNodes in such a way they work off the assumption that classes
 // will be held at the same time, on the same days, year after year.
 //------------------------------------------------------------------------------
 void normalizeMachines()
 {   //transfer all the same classes to the set of machine nodes
     if (quarters >= yearlength)
     {
         for (int i = yearlength; i < quarters; i++)
         {
             MachineNode oldMn = Quarters[i % yearlength];
             MachineNode newMn = Quarters[i];
             for (int j = 0; j < oldMn.GetMachines().Count; j++)
             {
                 Machine oldMachine = oldMn.GetMachines()[j];
                 Machine newMachine = new Machine(oldMachine);
                 newMachine.SetYear(i / yearlength);
                 newMn.AddMachine(newMachine);
             }
         }
         return;
     }
     else
     {
         return;
     }
 }