Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. using CryptoMiningSystem.Entities.Components.VideoCards.Contracts;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace CryptoMiningSystem
  9. {
  10. public abstract class VideoCard : Component, IVideoCard
  11. {
  12. public VideoCard(string model, int generation, int ram, decimal price)
  13. {
  14. this.Model = model;
  15. this.Generation = generation;
  16. this.Ram = ram;
  17. this.Price = price;
  18. }
  19. /*public VideoCard(int ram, decimal minedmph)
  20. {
  21. this.Ram = ram;
  22. this.MinedMoneyPerHour = minedmph;
  23. }
  24. public VideoCard(int ram)
  25. {
  26. this.Ram = ram;
  27. }*/
  28. private int ram;
  29.  
  30. public int Ram
  31. {
  32. get { return ram; }
  33. private set
  34. {
  35. //<=
  36. if (value < 0 || value > 32) throw new ArgumentException($"{Model} ram cannot less or equal to 0 and more than 32!");
  37. ram = value;
  38. }
  39. }
  40. /* private double generation;
  41. public double Generation
  42. {
  43. get { return generation; }
  44. set
  45. {
  46. if (value <= 0) throw new ArgumentException("Generation cannot be 0 or negative!");
  47. generation = value;
  48. }
  49. }*/
  50. /* private string videoCardType;
  51.  
  52. public string VideoCardType
  53. {
  54. get { return videoCardType; }
  55. set { videoCardType = value; }
  56. }*/
  57.  
  58. private decimal minedMoneyPerHour;
  59.  
  60. public decimal MinedMoneyPerHour
  61. {
  62. get { return (decimal)(Ram * Generation / 10);/* minedMoneyPerHour;*/ }
  63. set { minedMoneyPerHour = value; }
  64. }
  65. // private decimal lifeWorkingHours;
  66.  
  67. /* public decimal LifeWorkingHours
  68. {
  69. get { return (decimal)(Ram * Generation * 10);/*lifeWorkingHours; }
  70. set { lifeWorkingHours = value; }
  71. }*/
  72.  
  73. //decimal IVideoCard.MinedMoneyPerHour => throw new NotImplementedException();
  74. public VideoCard()
  75. {
  76. LifeWorkingHours = (int)(Ram * Generation * 10);
  77. }
  78. }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement