Example #1
0
        ulong GetAddExp(uint old_level, ulong old_exp, uint new_level, ulong new_exp)
        {
            if (old_level > new_level)
            {
                return(0);
            }
            if (old_level == new_level)
            {
                if (new_exp > old_exp)
                {
                    return(new_exp - old_exp);
                }
                return(0);
            }
            DBLevelExp db_level_exp = DBManager.Instance.GetDB <DBLevelExp>();
            ulong      add_exp      = 0;

            DBLevelExp.LevelExpInfo exp_info;
            for (uint level = old_level; level < new_level; ++level)
            {
                exp_info = db_level_exp.GetLevelInfo(level);
                if (exp_info != null)
                {
                    if (level == old_level)
                    {
                        add_exp = add_exp + exp_info.Exp - old_exp;
                    }
                    else
                    {
                        add_exp = add_exp + exp_info.Exp;
                    }
                }
            }
            add_exp = add_exp + new_exp;
            return(add_exp);
        }
Example #2
0
 public DBLevelExp(string strName, string strPath) :
     base(strName, strPath)
 {
     mInstance = this;
 }