public bool TryRegister(string username) { User user = _game.getUser(username); if (user == null) { _game.addUser(username); getUserDetails(_game.getUser(username)); return(true); } else { MessageBox.Show("User already exist!"); return(false); } }
public bool TryLogin(string username) { User user = _game.getUser(username); if (user == null) { MessageBox.Show("User not found!"); return(false); } else { this.getUserDetails(user); RefreshListBoxItems(); return(true); } }
private void getUserDetails(User user) { _userID = user.UserID; labelName.Text += user.Name; labelBalance.Text += user.Balance; }