Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using CryptoMiningSystem.Entities.Contracts;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace /*User*/CryptoMiningSystem
- {
- public class User : IUser
- {
- public User(string name, decimal money)
- {
- this.Name = name;
- this.Money = money;
- }
- private string name;
- public string Name
- {
- get { return name; }
- set
- {
- if (string.IsNullOrEmpty(value)) throw new ArgumentException("Username must not be null or empty!");
- name = value;
- }
- }
- // private int stars;
- public int Stars
- {
- //v const?!?
- get { return (int)this.Money / 100; }
- //set { stars = value; }
- }
- private decimal money;
- public decimal Money
- {
- get { return money; }
- set
- {
- if (value < 0) throw new ArgumentException("User's money cannot be less than 0!");
- money = value;
- }
- }
- private Computer computer;
- public Computer Computer
- {
- get { return computer; }
- set { computer = value; }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement