1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 07:42:57 +08:00

Simplify statistics in osu ruleset

This commit is contained in:
smoogipoo 2018-05-07 11:33:15 +09:00
parent 7eb64ab590
commit 251bdfdee8

View File

@ -5,7 +5,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.Objects;
namespace osu.Game.Rulesets.Osu.Beatmaps namespace osu.Game.Rulesets.Osu.Beatmaps
@ -14,28 +13,28 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
{ {
public override IEnumerable<BeatmapStatistic> GetStatistics() public override IEnumerable<BeatmapStatistic> GetStatistics()
{ {
IEnumerable<HitObject> circles = HitObjects.Where(c => c is HitCircle); int circles = HitObjects.Count(c => c is HitCircle);
IEnumerable<HitObject> sliders = HitObjects.Where(s => s is Slider); int sliders = HitObjects.Count(s => s is Slider);
IEnumerable<HitObject> spinners = HitObjects.Where(s => s is Spinner); int spinners = HitObjects.Count(s => s is Spinner);
return new[] return new[]
{ {
new BeatmapStatistic new BeatmapStatistic
{ {
Name = @"Circle Count", Name = @"Circle Count",
Content = circles.Count().ToString(), Content = circles.ToString(),
Icon = FontAwesome.fa_circle_o Icon = FontAwesome.fa_circle_o
}, },
new BeatmapStatistic new BeatmapStatistic
{ {
Name = @"Slider Count", Name = @"Slider Count",
Content = sliders.Count().ToString(), Content = sliders.ToString(),
Icon = FontAwesome.fa_circle Icon = FontAwesome.fa_circle
}, },
new BeatmapStatistic new BeatmapStatistic
{ {
Name = @"Spinner Count", Name = @"Spinner Count",
Content = spinners.Count().ToString(), Content = spinners.ToString(),
Icon = FontAwesome.fa_circle Icon = FontAwesome.fa_circle
} }
}; };