public Computer(ICpu cpu, IRam ram, IEnumerable<HardDrive> hardDrives, VideoCardBase videoCard) { this.Cpu = cpu; this.Ram = ram; this.HardDrives = hardDrives; this.VideoCard = videoCard; }
static void Main(string[] args) { IHardwareFactory hardwareFactory = null; hardwareFactory = new HighPerformanceHardwareFactory(); IProcessor processor = hardwareFactory.ProcessorModel(); IRam ram = hardwareFactory.RAMModel(); IHdd hdd = hardwareFactory.HDDModel(); processor.IntegrateProcessor(); ram.IntegrateRAM(); hdd.IntegrateHDD(); Console.WriteLine("-----------------------"); hardwareFactory = new FairPriceHardwareFactory(); processor = hardwareFactory.ProcessorModel(); ram = hardwareFactory.RAMModel(); hdd = hardwareFactory.HDDModel(); processor.IntegrateProcessor(); ram.IntegrateRAM(); hdd.IntegrateHDD(); }
public Computer(ICpu cpu, IRam ram, IEnumerable <HardDrive> hardDrives, VideoCardBase videoCard) { this.Cpu = cpu; this.Ram = ram; this.HardDrives = hardDrives; this.VideoCard = videoCard; }
/// <summary> /// Create new motherboard /// </summary> /// <param name="cpu">ICPU processor of any kind</param> /// <param name="ram">IRam ram memmory</param> /// <param name="hardDrive">IHardDrive storage</param> /// <param name="videoCard">IVideoCard videocard</param> public MotherBoard(ICPU cpu, IRam ram, IHardDrive hardDrive, IVideoCard videoCard) { this.Cpu = cpu; this.Ram = ram; this.HardDrive = hardDrive; this.Videocard = videoCard; }
public Cpu(IRegisters registers, IRam ram) { this.registers = registers; this.ram = ram; this.destinationProvider = new DestinationProvider(registers, ram); this.sourceProvider = new SourceProvider(registers, ram); }
public Cpu(IRam ram, IVideoCard videoCard, byte numberOfCores, CpuArchitecture architecture) { this.Ram = ram; this._videoCard = videoCard; NumberOfCores = numberOfCores; this.Architecture = architecture; }
internal PC(ICPU cpu, IRam ram, IHardDrive hardDrives, IVideoCard videoCard) { this.Cpu = cpu; this.Ram = ram; this.HardDrives = hardDrives; this.VideoCard = videoCard; }
public MotherBoard(ICpu cpu, IRam ram, IEnumerable <IHardDrive> hardDrives, IVideoCard videoCard) { this.cpu = cpu; this.ram = ram; this.hardDrives = hardDrives; this.videoCard = videoCard; }
public Cpu64( byte numberOfCores, IRam ram, IVideoCard videoCard) : base(numberOfCores, ram, videoCard) { }
static void Main(string[] args) { Driver driver = new Driver(); ICpu cpu = driver.Cpu; IRam ram = cpu.Ram; //code ram[0x4000] = 0x90; //lda ram[0x4001] = 0x8F; ram[0x4002] = 0x11; //add ram[0x4003] = 0x80; ram[0x4004] = 0x90; ram[0x4005] = 0x01; //halt //data ram[0x8090] = 0x00; while (!driver.IsHalted) { driver.Clock(); } Console.WriteLine(driver.Cpu.Acc); Console.WriteLine(driver.Cpu.Status); }
public Computer(ICpu cpu, IRam ram, IVideoCard gpu, IStorage storage) { Storage = storage; Gpu = gpu; Ram = ram; Cpu = cpu; }
internal Server(ICPU cpu, IRam ram, IHardDrive hardDrives) { this.Cpu = cpu; this.Ram = ram; this.HardDrives = hardDrives; this.VideoCard = new VideoCardMonochrome(); }
internal Laptop(ICPU cpu, IRam ram, IHardDrive hardDrives, IVideoCard videoCard, IBattery battery) { this.Cpu = cpu; this.Ram = ram; this.HardDrives = hardDrives; this.VideoCard = videoCard; this.Battery = battery; }
public BaseComputer(ICpu cpu, IRam ram, IVideoCard videoCard, IEnumerable <IHardDrive> hardDrives) { this.CPU = cpu; this.Ram = ram; this.HardDrives = hardDrives; this.VideoCard = videoCard; this.Motherboard = new MotherBoard(videoCard, ram, cpu); }
internal Computer(Cpu cpu, IRam ram, IEnumerable<HardDrive> hardDrives, VideoCard videoCard) { this.Cpu = cpu; this.Ram = ram; this.HardDrives = hardDrives; this.VideoCard = videoCard; this.motherboard = new Motherboard(this.Cpu, this.Ram, this.VideoCard); }
internal Cpu(byte numberOfCores, byte numberOfBits, IRam ram, VideoCardBase videoCard, BaseSquareNumberFinder squareNumberFinder) { this.NumberOfBits = numberOfBits; this.ram = ram; this.NumberOfCores = numberOfCores; this.videoCard = videoCard; this.squareNumberFinder = squareNumberFinder; }
public Computer(ICpu cpu, IRam ram, IEnumerable <IHardDriver> driver, IVideoCard videoCard) { this.Cpu = cpu; this.Ram = ram; this.Driver = driver; // to do this.VideoCard = videoCard; this.Motherboard = new Motherboard(this.Cpu, this.Ram, this.VideoCard); }
public AsrockH87(ICpu cpu, IRam ram, IFan cpuFan, ISolidStateDrive solidStateDrive, IGpu gpu, IBios bios) { Cpu = cpu; Ram = ram; CpuFan = cpuFan; SolidStateDrive = solidStateDrive; Gpu = gpu; Bios = bios; }
public Cpu8086(IRam ram, Intel8259 pic) { _ram = ram; _portDevices = new IPortDevice[256]; _pic = pic; SetRegister(Register.CS, 0xF000); SetRegister(Register.IP, 0xFFF0); }
public Cpu( byte numberOfCores, IRam ram, IVideoCard videoCard) { this.NumberOfCores = numberOfCores; this.Ram = ram; this.VideoCard = videoCard; }
internal Computer(IRam ram, ICpu cpu, IEnumerable <IHardDrive> drives, IVideoCard videoCard) { this.Ram = ram; this.Cpu = cpu; this.Drives = drives; this.VideoCard = videoCard; this.motherboard = new Motherboard(ram, cpu, videoCard); }
internal Laptop( CPUs.Cpu cpu, IRam ram, IEnumerable<HardDriver> hardDrives, VideoCard videoCard, ILaptopBattery laptopBattery) : base(cpu, ram, hardDrives, videoCard) { this.battery = laptopBattery; }
public override IComputer CreateComputer() { this.ram = new Ram(8); this.cpu = new Cpu64Bit(4); this.hardDrives = new[] { new HardDrive(1000, false, 0) }; var motherboard = new MotherBoard(this.cpu, this.ram, this.hardDrives, this.colorfullVideoCard); this.pc = new Computer(motherboard); return(this.pc); }
public Motherboard(ICpu cpu, IRam ram, IVideoCard videoCard) { cpu.Motherboard = this; this.Cpu = cpu; ram.Motherboard = this; this.Ram = ram; videoCard.Motherboard = this; this.VideoCard = videoCard; }
public MotherBoard(IVideoCard videoCard, IRam ram, ICpu cpu) { videoCard.Motherboard = this; this.VideoCard = videoCard; ram.Motherboard = this; this.Ram = ram; cpu.Motherboard = this; this.Cpu = cpu; }
internal Computer( Cpu cpu, IRam ram, IEnumerable <HardDrive> hardDrives, VideoCard videoCard) { this.Cpu = cpu; this.Ram = ram; this.HardDrives = hardDrives; this.VideoCard = videoCard; this.motherboard = new Motherboard(this.Cpu, this.Ram, this.VideoCard); }
public override ILaptop CreateLaptop() { this.ram = new Ram(8); this.cpu = new Cpu32Bit(4); this.hardDrives = new[] { new HardDrive(1000, false, 0) }; var motherboard = new MotherBoard(this.cpu, this.ram, this.hardDrives, this.colorfullVideoCard); this.laptop = new Laptop(motherboard, new LaptopBattery()); return(this.laptop); }
protected Computer( ICpu cpu, IRam ram, IEnumerable <IHardDrive> hardDrives, IVideoCard videoCard) { this.Cpu = cpu; this.Ram = ram; this.HardDrives = hardDrives; this.VideoCard = videoCard; this.Motherboard = new Motherboard(this.Cpu, this.Ram, this.VideoCard); }
protected Computer( ICpu cpu, IRam ram, IEnumerable<IHardDrive> hardDrives, IVideoCard videoCard) { this.Cpu = cpu; this.Ram = ram; this.HardDrives = hardDrives; this.VideoCard = videoCard; this.Motherboard = new Motherboard(this.Cpu, this.Ram, this.VideoCard); }
public override IServer CreateServer() { this.ram = new Ram(64); this.cpu = new Cpu64Bit(8); this.hardDrives = new List <IHardDrive> { new HardDrive(0, true, 2, new List <IHardDrive> { new HardDrive(2000, false, 0), new HardDrive(2000, false, 0) }) }; var motherboard = new MotherBoard(this.cpu, this.ram, this.hardDrives, this.monochromeVideoCard); this.server = new Server(motherboard); return(this.server); }
internal Computer( Cpu cpu, IRam ram, IEnumerable<HardDrive> hardDrives, IHardDrive hardDrive, LaptopBattery battery, IVideocard videocard) { this.cpu = cpu; this.ram = ram; this.hardDrives = hardDrives; this.hardDrive = hardDrive; this.videocard = videocard; this.battery = battery; }
public Computer ( IMotherboard motherboard, IRam ram, IGraphicsCard graphicsCard, IHardDiskDrive hdd, ICPU cpu ) { this.motherboard = motherboard; this.ram = ram; this.graphicsCard = graphicsCard; this.hdd = hdd; this.cpu = cpu; }
public int SquareNumber(IRam ram) { int data = ram.LoadValue(); if (data < 0) { throw new ArgumentOutOfRangeException(NegativeInputError); } else if (data > MaxPossibleInput) { throw new ArgumentOutOfRangeException(InputValueOutOfRange); } else { int value = data * data; return(value); } }
private void Start() { ICpu cpu = _driver.Cpu; IRam ram = cpu.Ram; ram[0x4000] = 0x90; //lda ram[0x4001] = 0x02; ram[0x4002] = 0x10; //add ram[0x4003] = 0x01; ram[0x4007] = 0x01; //halt while (!_driver.Halted) { _driver.Clock(); } }
public MockComputer(IRam _ram, IBrand _brand, IGraphicCard _graphics, ICountry _country, IMemory _memory, ICPU _cpu, IType _type, IDetail _detail) { ram = _ram; brand = _brand; country = _country; cpu = _cpu; memory = _memory; type = _type; graphic = _graphics; detail = _detail; List <RAM> rams = this.ram.Rams(); List <Brand> brands = this.brand.Brands(); List <CPU> processors = this.cpu.Processors(); List <Memory> memories = this.memory.Memories(); List <Country> countries = this.country.Countries(); List <Model.Type> types = this.type.Types(); List <GraphicCard> graphicCards = this.graphic.GraphicCards(); computers = new List <Computer>(); computers.Add(new Computer { ID = 0, Brand = brands[2], Name = brands[2].Name, MadeIn = countries[1], Ram = rams[3], GraphicCard = graphicCards[3], Memory = memories[4], Processor = processors[3], Type = types[0], Detail = new Detail { price = 1999.90f, Discount = 0, StockSize = 12, ComputerID = 0, Image = 0 + ".jpg" } }); computers.Add(new Computer { ID = 1, Brand = brands[1], Name = brands[1].Name, MadeIn = countries[0], Ram = rams[2], GraphicCard = graphicCards[2], Memory = memories[2], Processor = processors[3], Type = types[0], Detail = new Detail { price = 2000, Discount = 10, StockSize = 2, ComputerID = 1, Image = 1 + ".jpg" } }); computers.Add(new Computer { ID = 2, Brand = brands[3], Name = brands[3].Name, MadeIn = countries[2], Ram = rams[3], GraphicCard = graphicCards[1], Memory = memories[2], Processor = processors[1], Type = types[0], Detail = new Detail { price = 3000, Discount = 0, StockSize = 30, ComputerID = 2, Image = 2 + ".jpg" } }); computers.Add(new Computer { ID = 3, Brand = brands[2], Name = brands[2].Name, MadeIn = countries[3], Ram = rams[0], GraphicCard = graphicCards[0], Memory = memories[0], Processor = processors[2], Type = types[1], Detail = new Detail { price = 4999.9f, Discount = 30, StockSize = 2, ComputerID = 3, Image = 3 + ".jpg" } }); computers.Add(new Computer { ID = 4, Brand = brands[0], Name = brands[0].Name, MadeIn = countries[2], Ram = rams[1], GraphicCard = graphicCards[0], Memory = memories[3], Processor = processors[2], Type = types[0], Detail = new Detail { price = 7000, Discount = 0, StockSize = 2, ComputerID = 4, Image = 4 + ".jpg" } }); computers.Add(new Computer { ID = 5, Brand = brands[4], Name = brands[0].Name, MadeIn = countries[1], Ram = rams[3], GraphicCard = graphicCards[2], Memory = memories[2], Processor = processors[1], Type = types[1], Detail = new Detail { price = 9990, Discount = 10, StockSize = 2, ComputerID = 5, Image = 5 + ".jpg" } }); computers.Add(new Computer { ID = 6, Brand = brands[2], Name = brands[2].Name, MadeIn = countries[1], Ram = rams[1], GraphicCard = graphicCards[2], Memory = memories[2], Processor = processors[1], Type = types[1], Detail = new Detail { price = 9990, Discount = 10, StockSize = 2, ComputerID = 6, Image = 6 + ".jpg" } }); computers.Add(new Computer { ID = 7, Brand = brands[0], Name = brands[0].Name, MadeIn = countries[1], Ram = rams[3], GraphicCard = graphicCards[2], Memory = memories[2], Processor = processors[1], Type = types[1], Detail = new Detail { price = 9990, Discount = 10, StockSize = 2, ComputerID = 7, Image = 7 + ".jpg" } }); computers.Add(new Computer { ID = 8, Brand = brands[3], Name = brands[3].Name, MadeIn = countries[2], Ram = rams[2], GraphicCard = graphicCards[1], Memory = memories[2], Processor = processors[1], Type = types[1], Detail = new Detail { price = 9990, Discount = 10, StockSize = 20, ComputerID = 8, Image = 8 + ".jpg" } }); computers.Add(new Computer { ID = 9, Brand = brands[2], Name = brands[2].Name, MadeIn = countries[1], Ram = rams[1], GraphicCard = graphicCards[1], Memory = memories[2], Processor = processors[1], Type = types[1], Detail = new Detail { price = 10990, Discount = 0, StockSize = 20, ComputerID = 9, Image = 9 + ".jpg" } }); computers.Add(new Computer { ID = 10, Brand = brands[2], Name = brands[2].Name, MadeIn = countries[1], Ram = rams[1], GraphicCard = graphicCards[1], Memory = memories[2], Processor = processors[1], Type = types[1], Detail = new Detail { price = 10990, Discount = 0, StockSize = 20, ComputerID = 10, Image = 10 + ".jpg" } }); computers.Add(new Computer { ID = 11, Brand = brands[0], Name = brands[0].Name, MadeIn = countries[0], Ram = rams[2], GraphicCard = graphicCards[3], Memory = memories[1], Processor = processors[2], Type = types[1], Detail = new Detail { price = 12990, Discount = 10, StockSize = 10, ComputerID = 11, Image = 11 + ".jpg" } }); }
/// <summary> /// Sets the currently used parts and starts the computer /// </summary> /// <param name="binaryPath">Path to the binary to execute</param> /// <param name="cpu">The selected cpu module</param> /// <param name="ram">The selected ram module</param> /// <param name="timing">The selected timer</param> /// <param name="hardware">The selected generic hardware</param> public void setParts(string binaryPath, ICpu cpu, IRam ram, ITimer timing, List<IHardware> hardware) { this.cpu = cpu; this.ram = ram; this.hardware = hardware; loadFile(binaryPath); //Start a new thread which prints the registers to the console. new Thread((ThreadStart)delegate { while (true) { //Convert the current cpu status to a string string s = cpu.getRegisterSnapshot().Aggregate("", (current, register) => current + (register + "; ")); //Add the PC special register to the string s += cpu.getSpecialRegisters()[0] + "; "; AdvConsole.Debug(s); } }).Start(); timing.start(); }
public Motherboard(IVideoCard videoCard, IRam ram) { this.ram = ram; this.videoCard = videoCard; }
public Motherboard(IRam ram, ICpu cpu, IVideoCard videoCard) { this.ram = ram; this.videoCard = videoCard; cpu.AttachToMotherboard(this); }
protected PersonalComputer(ICpu cpu, IRam ram, IVideoCard gpu, IStorage storage) : base(cpu, ram, gpu, storage) { }
public Pc(ICpu cpu, IRam ram, IEnumerable<HardDrive> hardDrives, VideoCardBase videoCard) : base(cpu, ram, hardDrives, videoCard) { }
public DestinationProvider(IRegisters registers, IRam ram) { this.registers = registers; this.ram = ram; }
public ReadOnlyRam(IRam ram) { this.Ram = ram; }
public Server(ICpu cpu, IRam ram, IVideoCard gpu, IStorage storage) : base(cpu, ram, new MonochromVideoCard(), storage) { }
/// <summary> /// Populate the comboboxes with the items /// </summary> /// <param name="cpus">The possible cpus</param> /// <param name="rams">The possible ram</param> /// <param name="timers">The possible timers</param> private void populateCombo(ICpu[] cpus, IRam[] rams, ITimer[] timers) { //The generic format of the items const string listSetup = "{0} - {1} [{2}]"; foreach (var cpu in cpus) { cpuBox.Items.Add(string.Format(listSetup, cpu.Name, cpu.Author, cpu.Version)); } cpuBox.SelectedIndex = 0; foreach (var ram in rams) { ramBox.Items.Add(string.Format(listSetup, ram.Name, ram.Author, ram.Version)); } ramBox.SelectedIndex = 0; foreach (var timer in timers) { timerBox.Items.Add(string.Format(listSetup, timer.Name, timer.Author, timer.Version)); } timerBox.SelectedIndex = 0; }
public Server(ICpu cpu, IRam ram, IEnumerable <IHardDrive> hardDrives) : base(cpu, ram, new MonochromeVideoCard(), hardDrives) { }
public Laptop(ICpu cpu, IRam ram, IEnumerable <HardDrive> hardDrives, VideoCardBase videoCard, LaptopBattery battery) : base(cpu, ram, hardDrives, videoCard) { this.battery = battery; }
public Cpu(byte numberOfCores, byte numberOfBits, IRam ram) { this.numberOfCores = numberOfCores; this.numberOfBits = numberOfBits; this.ram = ram; }
public Laptop(ICpu cpu, IRam ram, IEnumerable<IHardDrive> hardDrives, IVideoCard videoCard, IBattery battery) : base(cpu, ram, hardDrives, videoCard) { this.battery = battery; }
public Laptop(ICpu cpu, IRam ram, IVideoCard gpu, IStorage storage, IRechargable battery) : base(cpu, ram, gpu, storage) { Battery = battery; }
public Motherboard(IRam ram, IVideoCard videoCard) { this.Ram = ram; this.VideoCard = videoCard; }
public Server(IRam ram, ICpu cpu, IEnumerable<IHardDrive> drives, IVideoCard videoCard) : base(ram, cpu, drives, videoCard) { }
public PersonalComputer(IRam ram, ICpu cpu, IEnumerable <IHardDrive> drives, IVideoCard videoCard) : base(ram, cpu, drives, videoCard) { }
public Laptop(IRam ram, ICpu cpu, IEnumerable<IHardDrive> drives, IVideoCard videoCard, IBattery battery) : base(ram, cpu, drives, videoCard) { this.Battery = battery; }
public Desktop(ICpu cpu, IRam ram, IVideoCard gpu, IStorage storage) : base(cpu, ram, gpu, storage) { }
public ProcessorE97(IRam ram) { this.ram = ram; }
public Server(ICpu cpu, IRam ram, IEnumerable<IHardDrive> hardDrives) : base(cpu, ram, hardDrives, new MonochromeVideoCard()) { }
public Motherboard(Cpu cpu, VideoCard videoCard, IRam ram) { cpu.AttachTo(this); this.Ram = ram; this.VideoCard = videoCard; }
public SourceProvider(IRegisters registers, IRam ram) { this.registers = registers; this.ram = ram; }