Exemplo n.º 1
0
 public Cpu(byte numberOfCores, byte numberOfBits, IRamMemory ram)
 {
     this.numberOfBits = numberOfBits;
     this.ram = ram;
     this.NumberOfCores = numberOfCores;
     this.videoCard = this.defaultVideoCard;
 }
Exemplo 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);
        }
Exemplo 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;
 }
Exemplo 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;
 }
Exemplo n.º 5
0
 public Pc(PcBuilder builder)
 {
     this.TotalPrice = builder.TotalPrice + InitalPricePc;
     this.Screen     = builder.Screen;
     this.Processor  = builder.Processor;
     this.RamMemory  = builder.RamMemory;
 }
Exemplo 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;
 }
Exemplo n.º 7
0
 public PC(PcBuilder builder)
 {
     _totalPrice = builder.TotalPrice + InitialPrice;
     _screen     = builder.Screen;
     _processor  = builder.Processor;
     _ramMemory  = builder.RamMemory;
 }
Exemplo n.º 8
0
        public string CalculateSquareNumber(IRamMemory ram)
        {
            int numberToProcess = this.LoadData(ram);
            string result = this.calculateSquareStrategy.GetSquare(numberToProcess);

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