private IEnumerable <BeatmapCardStatistic> createStatistics() { var hypesStatistic = HypesStatistic.CreateFor(BeatmapSet); if (hypesStatistic != null) { yield return(hypesStatistic); } var nominationsStatistic = NominationsStatistic.CreateFor(BeatmapSet); if (nominationsStatistic != null) { yield return(nominationsStatistic); } yield return(new FavouritesStatistic(BeatmapSet) { Current = FavouriteState }); yield return(new PlayCountStatistic(BeatmapSet)); var dateStatistic = BeatmapCardDateStatistic.CreateFor(BeatmapSet); if (dateStatistic != null) { yield return(dateStatistic); } }
private IEnumerable <BeatmapCardStatistic> createStatistics() { if (beatmapSet.HypeStatus != null) { yield return(new HypesStatistic(beatmapSet.HypeStatus)); } // web does not show nominations unless hypes are also present. // see: https://github.com/ppy/osu-web/blob/8ed7d071fd1d3eaa7e43cf0e4ff55ca2fef9c07c/resources/assets/lib/beatmapset-panel.tsx#L443 if (beatmapSet.HypeStatus != null && beatmapSet.NominationStatus != null) { yield return(new NominationsStatistic(beatmapSet.NominationStatus)); } yield return(new FavouritesStatistic(beatmapSet) { Current = favouriteState }); yield return(new PlayCountStatistic(beatmapSet)); var dateStatistic = BeatmapCardDateStatistic.CreateFor(beatmapSet); if (dateStatistic != null) { yield return(dateStatistic); } }
private void createStatistics() { BeatmapCardStatistic withMargin(BeatmapCardStatistic original) { original.Margin = new MarginPadding { Right = 10 }; return(original); } statisticsContainer.Content[0][0] = withMargin(new FavouritesStatistic(BeatmapSet) { Current = FavouriteState, }); statisticsContainer.Content[1][0] = withMargin(new PlayCountStatistic(BeatmapSet)); var hypesStatistic = HypesStatistic.CreateFor(BeatmapSet); if (hypesStatistic != null) { statisticsContainer.Content[0][1] = withMargin(hypesStatistic); } var nominationsStatistic = NominationsStatistic.CreateFor(BeatmapSet); if (nominationsStatistic != null) { statisticsContainer.Content[1][1] = withMargin(nominationsStatistic); } var dateStatistic = BeatmapCardDateStatistic.CreateFor(BeatmapSet); if (dateStatistic != null) { statisticsContainer.Content[0][2] = withMargin(dateStatistic); } }