Пример #1
0
 public User(string username, string password, string email, int money)
 {
     hasher   = new UserHash();
     Username = username;
     if (password.Equals(""))
     {
         throw new NotAPasswordException("");
     }
     Password     = hasher.GetHashed(username, password);
     Email        = email;
     MoneyBalance = money;
     Stats        = new Statistics();
     League       = new DefaultLeague();
 }
Пример #2
0
 public User(string username, string password, string email)
 {
     hasher   = new UserHash();
     Username = username;
     if (username.Equals(""))
     {
         throw new DomainException("Invalid username - can't be empty");
     }
     if (password.Equals(""))
     {
         throw new NotAPasswordException("");
     }
     Password     = hasher.GetHashed(username, password);
     Email        = email;
     Stats        = new Statistics();
     League       = new DefaultLeague();
     MoneyBalance = 10000;
 }
Пример #3
0
 public bool CheckPassword(string password)
 {
     return(Password.Equals(hasher.GetHashed(Username, password)));
 }