コード例 #1
0
ファイル: CPU.cs プロジェクト: kingbsolomon/BuildComputer
 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);
     }
 }
コード例 #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);
 }
コード例 #3
0
 //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);
 }
コード例 #4
0
 //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;
 }
コード例 #5
0
ファイル: CPU.cs プロジェクト: kingbsolomon/BuildComputer
        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;
            }
        }
コード例 #6
0
ファイル: CPU.cs プロジェクト: kingbsolomon/BuildComputer
        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;
            }
        }
コード例 #7
0
ファイル: CPU.cs プロジェクト: kingbsolomon/BuildComputer
 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);
     }
 }