コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
 private void getUserDetails(User user)
 {
     _userID            = user.UserID;
     labelName.Text    += user.Name;
     labelBalance.Text += user.Balance;
 }