Beispiel #1
0
 public void finished(string name)
 {
     MemoryProcess temp = search(name);
     if(temp != null)
     {
         temp.name = temp.name + "done";
         greenOne.GetComponent<Button>().GetComponent<Image>().color = Color.cyan;
         greenAttribute.isOccupied = false;
         greenAttribute.available = true;
         greenOne = null;
         greenAttribute = null;
     }
 }
Beispiel #2
0
 public void run(string name)
 {
     if(search(name) != null)
     {
         for(int i = 0; i < 8; i++)
         {
             for(int j = 0; j < 8; j++)
             {
                 if(memoryMapAttributes[i,j].processName.Equals(name))
                 {
                     if(greenOne != null)
                     {
                         greenOne.GetComponent<Button>().GetComponent<Image>().color = Color.yellow;
                         greenAttribute.isRunning = false;
                     }
                     greenOne = memoryMap[i,j];
                     greenAttribute = memoryMapAttributes[i,j];
                     greenAttribute.isRunning = true;
                     memoryMap[i,j].GetComponent<Button>().GetComponent<Image>().color = Color.green;
                     memoryMapAttributes[i,j].osOccupied = false;
                     memoryMapAttributes[i,j].isOccupied = true;
                     memoryMapAttributes[i,j].available = true;
                     memoryMapAttributes[i,j].hasInfo = true;
                 }
             }
         }
     }
 }
Beispiel #3
0
 private void initializeMap()
 {
     for(int i = 0; i < 8; i++)
         for(int j = 0; j < 8; j++)
             memoryMapAttributes[i,j] = new PageMatrix ();
 }
Beispiel #4
0
 public void preSwap(string name)
 {
     int randomNumber;
     MemoryProcess temp = search(name);
     if(temp != null)
     {
         greenOne.GetComponent<Button>().GetComponent<Image>().color = Color.cyan;
         greenAttribute.isOccupied = false;
         greenAttribute.available = true;
         randomNumber = ((Func<int>)(() => {
                 System.Random rnd = new System.Random();
                 int dice = rnd.Next(0,greenAttribute.process.pageNumber - 1);
                 return dice;
             }))();
         greenAttribute.process.pageRunning = randomNumber;
         greenOne = null;
         greenAttribute = null;
     }
 }