public long GetMaxExp(int level) { if (ExpFormula == null) { return(0); } if (ExpValues.Count <= level) { ExpValues.Capacity = level + 1; for (int i = ExpValues.Count - 1; i <= level; ++i) { double prev = ExpValues[i]; MeNode sanitized = Sanitizer.ReplaceExpValues(ExpFormula, (long)prev, i + 1); ExpValues.Add((long)Math.Floor(sanitized.Resolve().Value.ToDouble())); } } return(ExpValues[level]); }