Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using CryptoMiningSystem.Entities.Components.VideoCards.Contracts;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace CryptoMiningSystem
- {
- public abstract class VideoCard : Component, IVideoCard
- {
- public VideoCard(string model, int generation, int ram, decimal price)
- {
- this.Model = model;
- this.Generation = generation;
- this.Ram = ram;
- this.Price = price;
- }
- /*public VideoCard(int ram, decimal minedmph)
- {
- this.Ram = ram;
- this.MinedMoneyPerHour = minedmph;
- }
- public VideoCard(int ram)
- {
- this.Ram = ram;
- }*/
- private int ram;
- public int Ram
- {
- get { return ram; }
- private set
- {
- //<=
- if (value < 0 || value > 32) throw new ArgumentException($"{Model} ram cannot less or equal to 0 and more than 32!");
- ram = value;
- }
- }
- /* private double generation;
- public double Generation
- {
- get { return generation; }
- set
- {
- if (value <= 0) throw new ArgumentException("Generation cannot be 0 or negative!");
- generation = value;
- }
- }*/
- /* private string videoCardType;
- public string VideoCardType
- {
- get { return videoCardType; }
- set { videoCardType = value; }
- }*/
- private decimal minedMoneyPerHour;
- public decimal MinedMoneyPerHour
- {
- get { return (decimal)(Ram * Generation / 10);/* minedMoneyPerHour;*/ }
- set { minedMoneyPerHour = value; }
- }
- // private decimal lifeWorkingHours;
- /* public decimal LifeWorkingHours
- {
- get { return (decimal)(Ram * Generation * 10);/*lifeWorkingHours; }
- set { lifeWorkingHours = value; }
- }*/
- //decimal IVideoCard.MinedMoneyPerHour => throw new NotImplementedException();
- public VideoCard()
- {
- LifeWorkingHours = (int)(Ram * Generation * 10);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement