private void Init() { var comp = _CompareUser.GetComparison(player.UserId); if (comp.ActiveHoursComparison.PercentileAmounts.Length == 0 || comp.SleepComparison.PercentileAmounts.Length == 0 || comp.StepsComparison.PercentileAmounts.Length == 0) { ShowMessage("Looks like we need more data from other users to compare your progress."); return; } AddProgressToGrid(comp.StepsComparison, 0); AddProgressToGrid(comp.SleepComparison, 1); AddProgressToGrid(comp.ActiveHoursComparison, 2); }
private string GetComparisonMessage(string userId) { var comparison = _comparisonFetcher.GetComparison(userId); var userStepsPercentile = comparison.StepsComparison.UserPercentile; var userActivityPercentile = comparison.ActiveHoursComparison.UserPercentile; if (userActivityPercentile > userStepsPercentile && userActivityPercentile > 5) { var percentage = String.Concat(userActivityPercentile.ToString(), "0%"); return(String.Concat("are more active than ", percentage)); } if (userStepsPercentile > 5) { var percentage = String.Concat(userStepsPercentile.ToString(), "0%"); return(String.Concat("take more steps than ", percentage)); } return(null); }