Esempio n. 1
0
 public int RegisterPlayer(IPlayerRegistrationInfo p)
 {
     if (_playersByName.ContainsKey(p.Username)) throw new DuplicateUsernameException();
       PlayerInfo np = new PlayerInfo(p);
       _players.Add(np.PlayerId, np);
       _playersByName.Add(np.Username, np);
       return np.PlayerId;
 }
Esempio n. 2
0
 public PlayerInfo(IPlayerRegistrationInfo reg)
 {
     this._address  = reg.Address;
     this._balance  = 0;
     this._city     = reg.City;
     this._country  = reg.Country;
     this._name     = reg.Name;
     this._postcode = reg.PostCode;
     this._playerId = nextId++;
     this._username = reg.Username;
     this._password = reg.Password;
 }
Esempio n. 3
0
 public PlayerInfo(IPlayerRegistrationInfo reg)
 {
     this._address = reg.Address;
       this._balance = 0;
       this._city = reg.City;
       this._country = reg.Country;
       this._name = reg.Name;
       this._postcode = reg.PostCode;
       this._playerId = nextId++;
       this._username = reg.Username;
       this._password = reg.Password;
 }
Esempio n. 4
0
        public int RegisterPlayer(IPlayerRegistrationInfo p)
        {
            if (_playersByName.ContainsKey(p.Username))
            {
                throw new DuplicateUsernameException();
            }
            PlayerInfo np = new PlayerInfo(p);

            _players.Add(np.PlayerId, np);
            _playersByName.Add(np.Username, np);
            return(np.PlayerId);
        }