Exemple #1
0
        public static (uint rank, ulong exp) GetRankAndExpFromTotalExp(ulong totalExp)
        {
            uint currentRank = 0;

            while (totalExp > 0)
            {
                ulong expNeeded = ExpUtils.GetNextRankExpRequirement(currentRank);

                try
                {
                    checked
                    {
                        totalExp -= expNeeded;
                        currentRank++;

                        if (totalExp == 0)
                        {
                            break;
                        }
                    }
                }
                catch (OverflowException)
                {
                    break;
                }
            }

            return(currentRank, totalExp);
        }
Exemple #2
0
 public static ulong GetExpEarnedForFinishing(double finishTime) => (ulong)Math.Round(ExpUtils.EXP_FOR_FINISHING * ExpUtils.GetPlaytimeMultiplayer(finishTime));