Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. using CryptoMiningSystem.Entities.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 /*User*/CryptoMiningSystem
  9. {
  10. public class User : IUser
  11. {
  12.  
  13. public User(string name, decimal money)
  14. {
  15. this.Name = name;
  16. this.Money = money;
  17. }
  18. private string name;
  19.  
  20. public string Name
  21. {
  22. get { return name; }
  23. set
  24. {
  25. if (string.IsNullOrEmpty(value)) throw new ArgumentException("Username must not be null or empty!");
  26. name = value;
  27. }
  28. }
  29. // private int stars;
  30.  
  31. public int Stars
  32. {
  33. //v const?!?
  34. get { return (int)this.Money / 100; }
  35. //set { stars = value; }
  36. }
  37. private decimal money;
  38.  
  39. public decimal Money
  40. {
  41. get { return money; }
  42. set
  43. {
  44. if (value < 0) throw new ArgumentException("User's money cannot be less than 0!");
  45. money = value;
  46. }
  47. }
  48.  
  49. private Computer computer;
  50.  
  51. public Computer Computer
  52. {
  53. get { return computer; }
  54. set { computer = value; }
  55. }
  56.  
  57. }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement