Beispiel #1
0
 public bool CheckGameRequirements(Games game, HardDrive hardDrive, RAM ram,
                                   GPU gpu)
 {
     if ((game.requiredRAM <= ram.totalGigabytes) &&
         (game.requiredStorage <= hardDrive.availableStorage) &&
         (game.requiredEffectiveMemory <= ram.totalGigabytes))
     {
         Console.WriteLine("You can install this Game");
         return(true);
     }
     else
     {
         if (game.requiredRAM > ram.totalGigabytes)
         {
             Console.WriteLine("You do not have enought RAM");
         }
         if (game.requiredStorage > hardDrive.availableStorage)
         {
             Console.WriteLine("You do not have enough available storage");
         }
         else
         {
             Console.WriteLine("Your GPU is not powerful enough to run this game");
         }
         return(false);
     }
 }
Beispiel #2
0
 //constructor
 public Computer()
 {
     ram         = new RAM(60, "CORSAIR");
     cpu         = new CPU("AMD", "Ryzen 9");
     gpu         = new GPU("NVIDIA", 8.0);
     hardDrive   = new HardDrive(2000.00, 1985.00);
     motherboard = new Motherboard("ASUS", cpu, ram, hardDrive, gpu);
 }
 //constructor
 public Computer()
 {
     hardDrive   = new HardDrive(100, 100);
     cpu         = new CPU("Apple", "MyCPU");
     gpu         = new GPU("Apple", 100);
     ram         = new RAM(100, "Apple");
     motherboard = new Motherboard("Apple", cpu, ram, hardDrive, gpu);
 }
 //Constructor
 public Motherboard(string manufacturer, CPU processor,
                    RAM temporaryMemory, HardDrive storage, GPU graphics)
 {
     this.manufacturer    = manufacturer;
     this.processor       = processor;
     this.temporaryMemory = temporaryMemory;
     this.storage         = storage;
     this.graphics        = graphics;
 }
Beispiel #5
0
        public void ProcessAppInstall(Applications app, HardDrive hardDrive, RAM ram)
        {
            bool check = CheckAppRequirements(app, hardDrive, ram);

            if (check)
            {
                hardDrive.applicationsInHardDrive.Add(app);
                hardDrive.availableStorage -= app.requiredStorage;
            }
        }
Beispiel #6
0
        public void ProcessGameInstall(Games game, HardDrive hardDrive, RAM ram,
                                       GPU gpu)
        {
            bool check = CheckGameRequirements(game, hardDrive, ram, gpu);

            if (check)
            {
                hardDrive.applicationsInHardDrive.Add(game);
                hardDrive.availableStorage -= game.requiredStorage;
            }
        }
Beispiel #7
0
 public bool CheckAppRequirements(Applications app, HardDrive hardDrive, RAM ram)
 {
     if (app.requiredRAM <= ram.totalGigabytes &&
         app.requiredStorage <= hardDrive.availableStorage)
     {
         Console.WriteLine("You can install this application");
         return(true);
     }
     else
     {
         if (app.requiredRAM > ram.totalGigabytes)
         {
             Console.WriteLine("You do not have enought RAM");
         }
         else
         {
             Console.WriteLine("You do not have enough available storage");
         }
         return(false);
     }
 }