Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. using CryptoMiningSystem.Utilities;
  2. using System;
  3.  
  4. namespace CryptoMiningSystem.Entities.Components.VideoCards
  5. {
  6. public class MineVideoCard : VideoCard
  7. {
  8. private const int increseInManeMoneyPerHour = 8;
  9. private const int increseInLifeWorkingHours = 2;
  10. public MineVideoCard(string model, int generation,int ram, decimal price)
  11. : base(model, price, generation, ram)
  12. {
  13. this.Generation = generation;
  14. this.MinedMoneyPerHour = increseInManeMoneyPerHour;
  15. this.LifeWorkingHours = increseInLifeWorkingHours;
  16. }
  17.  
  18. public override int Generation
  19. {
  20. get => base.Generation;
  21.  
  22. set
  23. {
  24. if (value > 9)
  25. {
  26. throw new ArgumentException("Game video card generation cannot be more than 9!");
  27. }
  28. base.Generation = value;
  29. }
  30. }
  31. public override decimal MinedMoneyPerHour
  32. {
  33. get => base.MinedMoneyPerHour;
  34. set => base.MinedMoneyPerHour = base.MinedMoneyPerHour * value;
  35. }
  36.  
  37. public override int LifeWorkingHours
  38. {
  39. get => base.LifeWorkingHours;
  40. set => base.LifeWorkingHours = base.LifeWorkingHours * value;
  41. }
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement