Exemplo n.º 1
0
        /// <summary>
        /// Creates a new record in Rank History for new season based on old season
        /// </summary>
        public void SeasonStartRank(int newSeason, int oldSeason)
        {
            int elo      = this.GetUserEloAtSeason(oldSeason);
            int startElo = this.GetUserBeginningEloAtSeason(oldSeason);

            RankingHistoryDal.InsertRankHistory(username, newSeason, ((elo + startElo) / 2));
        }
Exemplo n.º 2
0
 /// <summary>
 /// user constructor which inserts a new user into user table using details
 /// </summary>
 public User(string username, UserType type, string email, DateTime BirthDate, string fName, string lName, string password)
 {
     _level         = 1;
     _xp            = 0;
     this.BirthDate = BirthDate;
     this.fName     = fName;
     this.lName     = lName;
     this.type      = type;
     this.username  = username;
     if (BLL_Helper.UserExists(username))
     {
         throw new Exception("A user with that username already exists");
     }
     DAL.UserDal.AddUser(email, password, (int)type, fName, lName, BirthDate, username);
     RankingHistoryDal.InsertRankHistory(username, BLL_Helper.GetCurrentSeason().SeasonID, InitailElo);
 }