Example #1
0
 public Player(PlayerRegistration registration) {
     Balance = 0M;
     UserName = registration.UserName;
     Password = registration.Password;
     Name = registration.Name;
     Address = registration.Address;
     City = registration.City;
     Country = registration.Country;
     PostCode = registration.PostCode;
     Verification = new Random().Next().ToString();
 }
Example #2
0
        public Response Register(PlayerRegistration registration)
        {
            if (players.GetPlayers(registration.UserName).Any())
            {
                return(new Response(false, "Duplicate user name"));
            }

            var newPlayer = new Player(registration);

            players.Add(newPlayer);
            return(new Response(true, "Player registered", newPlayer.Verification));
        }
Example #3
0
 public Player(PlayerRegistration registration)
 {
     Balance      = 0M;
     UserName     = registration.UserName;
     Password     = registration.Password;
     Name         = registration.Name;
     Address      = registration.Address;
     City         = registration.City;
     Country      = registration.Country;
     PostCode     = registration.PostCode;
     Verification = new Random().Next().ToString();
 }