Ejemplo n.º 1
0
 public Cpu(byte numberOfCores, byte numberOfBits, IRamMemory ram)
 {
     this.numberOfBits = numberOfBits;
     this.ram = ram;
     this.NumberOfCores = numberOfCores;
     this.videoCard = this.defaultVideoCard;
 }
Ejemplo n.º 2
0
        public void GenerateRandomNumber(int minValue, int maxValue, IRamMemory ram)
        {
            Random random = new Random();
            int randomNumber = random.Next(minValue, maxValue);

            ram.SaveInteger(randomNumber);
        }
Ejemplo n.º 3
0
 public Server(ICpu cpu, IRamMemory ram, IEnumerable<IHardDrive> hardDrives)
 {
     this.Cpu = cpu;
     this.Ram = ram;
     this.HardDrives = hardDrives;
     this.VideoCard = this.defaultVideoCard;
 }
Ejemplo n.º 4
0
 public Computer(ICpu cpu, IRamMemory ram, IVideoCard videoCard, IEnumerable<IHardDrive> hardDrives)
 {
     this.cpu = cpu;
     this.ram = ram;
     this.videoCard = videoCard;
     this.hardDrives = hardDrives;
 }
Ejemplo n.º 5
0
 public Pc(PcBuilder builder)
 {
     this.TotalPrice = builder.TotalPrice + InitalPricePc;
     this.Screen     = builder.Screen;
     this.Processor  = builder.Processor;
     this.RamMemory  = builder.RamMemory;
 }
Ejemplo n.º 6
0
 public MotherBoard(IRamMemory ram, ICpu cpu, IHardDrive hardDrive, IVideoCard videoCard)
 {
     this.ram = ram;
     this.cpu = cpu;
     this.hardDrive = hardDrive;
     this.videoCard = videoCard;
 }
Ejemplo n.º 7
0
 public PC(PcBuilder builder)
 {
     _totalPrice = builder.TotalPrice + InitialPrice;
     _screen     = builder.Screen;
     _processor  = builder.Processor;
     _ramMemory  = builder.RamMemory;
 }
Ejemplo n.º 8
0
        public string CalculateSquareNumber(IRamMemory ram)
        {
            int numberToProcess = this.LoadData(ram);
            string result = this.calculateSquareStrategy.GetSquare(numberToProcess);

            return result;
        }
Ejemplo n.º 9
0
 public override Server ManufactureServer()
 {
     this.ram = new RamMemory(32);
     this.cpu = new Cpu(4, 32, this.ram);
     this.hardDrives = new List<HardDriver>
     {
         new HardDriver(0, true, 2, new List<HardDriver> { new HardDriver(1000, false, 0), new HardDriver(1000, false, 0) })
     };
     return new Server(this.cpu, this.ram, this.hardDrives);
 }
Ejemplo n.º 10
0
        // The hardcoded values are used on only one place so i think that there is no need of constants.
        public override PersonalComputer ManufacturePC()
        {
            this.ram = new RamMemory(4);
            this.videoCard = new MonochromeVideoCard();
            this.cpu = new Cpu(2, 64, this.ram, this.videoCard);
            this.hardDrives = new[]
            {
                new HardDriver(2000, false, 0)
            };

            return new PersonalComputer(this.cpu, this.ram, this.videoCard, this.hardDrives);
        }
Ejemplo n.º 11
0
        // The hardcoded values are used on only one place so i think that there is no need of constants.
        public override PersonalComputer ManufacturePC()
        {
            this.ram = new RamMemory(8);
            this.videoCard = new ColorfulVideoCard();
            this.cpu = new Cpu(4, 64, this.ram, this.videoCard);
            this.hardDrives = new[]
            {
                new HardDriver(1000, false, 0)
            };

            return new PersonalComputer(this.cpu, this.ram, this.videoCard, this.hardDrives);
        }
Ejemplo n.º 12
0
        public override Laptop ManufactureLaptop()
        {
            this.ram = new RamMemory(8);
            this.videoCard = new ColorfulVideoCard();
            this.cpu = new Cpu(4, 32, this.ram, this.videoCard);
            this.hardDrives = new[]
            {
                new HardDriver(1000, false, 0)
            };
            IBattery battery = BatteryFactory.GetBattery(BatteryType.LaptopBattery);

            return new Laptop(this.cpu, this.ram, this.videoCard, this.hardDrives, battery);
        }
Ejemplo n.º 13
0
 public Motherboard(IVideoCard videocard, IRamMemory ram)
 {
     this.VideoCard = videocard;
     this.Ram = ram;
 }
Ejemplo n.º 14
0
 public Cpu(byte numberOfCores, byte numberOfBits, IRamMemory ram, IVideoCard videoCard)
     : this(numberOfCores, numberOfBits, ram)
 {
     this.videoCard = videoCard;
 }
Ejemplo n.º 15
0
 public PcMotherBoard(IRamMemory ram, ICpu cpu, IHardDrive hardDrive, IVideoCard videoCard)
     : base(ram, cpu, hardDrive, videoCard)
 {
 }
Ejemplo n.º 16
0
 public PersonalComputer(ICpu cpu, IRamMemory ram, IVideoCard videoCard, IEnumerable<IHardDrive> hardDrives)
     : base(cpu, ram, videoCard, hardDrives)
 {
 }
Ejemplo n.º 17
0
 public Laptop(ICpu cpu, IRamMemory ram, IVideoCard videoCard, IEnumerable<IHardDrive> hardDrives, IBattery battery)
     : base(cpu, ram, videoCard, hardDrives)
 {
     this.Battery = battery;
 }
Ejemplo n.º 18
0
 public Motherboard(IVideoCard videocard, IRamMemory ram)
 {
     this.VideoCard = videocard;
     this.Ram       = ram;
 }
Ejemplo n.º 19
0
 public LaptopMotherBoard(IRamMemory ram, ICpu cpu, IHardDrive hardDrive, IVideoCard videoCard, IBattery battery)
     : base(ram, cpu, hardDrive, videoCard)
 {
     this.Battery = battery;
 }
Ejemplo n.º 20
0
 public PcBuilder WithRamMemory(IRamMemory RamMemory)
 {
     this.RamMemory   = RamMemory;
     this.TotalPrice += RamMemory.Prix;
     return(this);
 }
Ejemplo n.º 21
0
 private int LoadData(IRamMemory ram)
 {
     return ram.LoadInteger();
 }
Ejemplo n.º 22
0
 public PcBuilder WithRamMemory(IRamMemory ramMemory)
 {
     RamMemory   = ramMemory;
     TotalPrice += ramMemory.Price;
     return(this);
 }
Ejemplo n.º 23
0
 private void SaveData(int numberToStore, IRamMemory ram)
 {
     ram.SaveInteger(numberToStore);
 }