コード例 #1
0
ファイル: User.cs プロジェクト: itai192/Taki-Online
        /// <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));
        }
コード例 #2
0
ファイル: User.cs プロジェクト: itai192/Taki-Online
 /// <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);
 }