コード例 #1
0
        }                                                      //The graphics card attached to this motherboard

        /// <summary>
        /// Initializes the motherboard
        /// </summary>
        /// <param name="memorySlots">The amount of memory slots</param>
        /// <param name="powerConsumption">The power consumption in Watts that the motherboard needs to consume</param>
        /// <param name="pciSlots">The amount of PCI slots</param>
        /// <param name="formFactor">The form factor of this motherboard</param>
        /// <param name="hardDriveLimit">The limit of harddrives this motherboard has</param>
        /// <param name="cpu">The CPU</param>
        /// <param name="memory">All of the memory attached to this motherboard, cannot exceed the `memorySlots` value</param>
        /// <param name="graphicsCard">The graphics card</param>
        public Motherboard(int memorySlots, int powerConsumption, int pciSlots, FormFactor formFactor, int hardDriveLimit, CPU cpu, Memory[] memory, GraphicsCard graphicsCard)
        {
            if (memorySlots < memory.Length)
            {
                throw new ArgumentOutOfRangeException("Amount of memory cards exceed amount of available memory slots");
            }
            if (powerConsumption < 0)
            {
                throw new ArgumentOutOfRangeException("Power Consumption must be a positive value");
            }
            if (pciSlots < 0)
            {
                throw new ArgumentOutOfRangeException("PCI Slots must be a positive value");
            }
            if (hardDriveLimit < 1)
            {
                throw new ArgumentOutOfRangeException("HardDrive limit must be greater than 0");
            }

            MemorySlots      = memorySlots;
            PowerConsumption = powerConsumption;
            PCISlots         = pciSlots;
            FormFactor       = formFactor;
            HardDriveLimit   = hardDriveLimit;
            CPU          = cpu;
            Memory       = memory;
            GraphicsCard = graphicsCard;
        }
コード例 #2
0
        /// <summary>
        /// Creates an old motherboard with a slow cpu and little memory.
        /// Graphics card is slow.
        /// </summary>
        public void BuildMotherboard()
        {
            FormFactor formFactor = new FormFactor(
                name: "ATX",
                date: new DateTime(2001, 01, 01),
                width: 12,
                depth: 9.6,
                usbSlots: 8
                );

            CPU cpu = new CPU(
                speed: 2.8,
                Manufacturer.AMD,
                socketType: "S1",
                cacheSize: 2048,
                cores: 4
                );

            Memory[] memory = new Memory[2]
            {
                new Memory(
                    readSpeed: 800,
                    writeSpeed: 800,
                    type: MemoryType.DDR3,
                    size: 1024
                    ),
                new Memory(
                    readSpeed: 800,
                    writeSpeed: 800,
                    type: MemoryType.DDR3,
                    size: 1024
                    )
            };

            GraphicsCard graphicsCard = new GraphicsCard(
                speed: 800,
                videoMemory: 2048,
                cudaCores: 1200,
                fans: 1
                );

            Computer.Motherboard = new Motherboard(
                memorySlots: 4,
                powerConsumption: 500,
                pciSlots: 3,
                formFactor: formFactor,
                hardDriveLimit: 2,
                cpu: cpu,
                memory: memory,
                graphicsCard: graphicsCard
                );
        }
コード例 #3
0
        /// <summary>
        /// Creates an semi-new motherboard with a good cpu and average amount of memory.
        /// Graphics card is medium-speed.
        /// </summary>
        public void BuildMotherboard()
        {
            FormFactor formFactor = new FormFactor(
                name: "ATX",
                date: new DateTime(2015, 01, 01),
                width: 12,
                depth: 9.6,
                usbSlots: 8
                );

            CPU cpu = new CPU(
                speed: 3.6,
                Manufacturer.AMD,
                socketType: "AM4",
                cacheSize: 4096,
                cores: 6
                );

            Memory[] memory = new Memory[4]
            {
                new Memory(
                    readSpeed: 2000,
                    writeSpeed: 2000,
                    type: MemoryType.DDR4,
                    size: 2048
                    ),
                new Memory(
                    readSpeed: 2000,
                    writeSpeed: 2000,
                    type: MemoryType.DDR4,
                    size: 2048
                    ),
                new Memory(
                    readSpeed: 2000,
                    writeSpeed: 2000,
                    type: MemoryType.DDR4,
                    size: 2048
                    ),
                new Memory(
                    readSpeed: 2000,
                    writeSpeed: 2000,
                    type: MemoryType.DDR4,
                    size: 2048
                    )
            };

            GraphicsCard graphicsCard = new GraphicsCard(
                speed: 1500,
                videoMemory: 4096,
                cudaCores: 2000,
                fans: 2
                );

            Computer.Motherboard = new Motherboard(
                memorySlots: 4,
                powerConsumption: 700,
                pciSlots: 4,
                formFactor: formFactor,
                hardDriveLimit: 4,
                cpu: cpu,
                memory: memory,
                graphicsCard: graphicsCard
                );
        }
コード例 #4
0
        /// <summary>
        /// Creates an new motherboard with a very good cpu and high amount of memory.
        /// Graphics card is very fast.
        /// </summary>
        public void BuildMotherboard()
        {
            FormFactor formFactor = new FormFactor(
                name: "ATX",
                date: new DateTime(2021, 01, 01),
                width: 12,
                depth: 9.6,
                usbSlots: 8
                );

            CPU cpu = new CPU(
                speed: 4.8,
                Manufacturer.Intel,
                socketType: "LGA 1151",
                cacheSize: 4096,
                cores: 12
                );

            Memory[] memory = new Memory[4]
            {
                new Memory(
                    readSpeed: 4096,
                    writeSpeed: 4096,
                    type: MemoryType.DDR4,
                    size: 4096
                    ),
                new Memory(
                    readSpeed: 4096,
                    writeSpeed: 4096,
                    type: MemoryType.DDR4,
                    size: 4096
                    ),
                new Memory(
                    readSpeed: 4096,
                    writeSpeed: 4096,
                    type: MemoryType.DDR4,
                    size: 4096
                    ),
                new Memory(
                    readSpeed: 4096,
                    writeSpeed: 4096,
                    type: MemoryType.DDR4,
                    size: 4096
                    )
            };

            GraphicsCard graphicsCard = new GraphicsCard(
                speed: 3200,
                videoMemory: 8192,
                cudaCores: 3000,
                fans: 3
                );

            Computer.Motherboard = new Motherboard(
                memorySlots: 6,
                powerConsumption: 850,
                pciSlots: 4,
                formFactor: formFactor,
                hardDriveLimit: 6,
                cpu: cpu,
                memory: memory,
                graphicsCard: graphicsCard
                );
        }