1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:57:39 +08:00

correctly count HitObjects for their type

also legacy classes are internal again
This commit is contained in:
Aergwyn 2017-12-13 16:32:32 +01:00
parent 1d206f7ec6
commit d4cd835419
5 changed files with 27 additions and 18 deletions

View File

@ -17,7 +17,8 @@ using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Osu.Scoring;
using osu.Game.Rulesets.Osu.Edit;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Objects.Legacy.Osu;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Objects;
namespace osu.Game.Rulesets.Osu
{
@ -33,21 +34,29 @@ namespace osu.Game.Rulesets.Osu
new KeyBinding(InputKey.MouseRight, OsuAction.RightButton),
};
public override IEnumerable<BeatmapStatistic> GetBeatmapStatistics(WorkingBeatmap beatmap) => new[]
public override IEnumerable<BeatmapStatistic> GetBeatmapStatistics(WorkingBeatmap beatmap)
{
new BeatmapStatistic
IEnumerable<HitObject> hitObjects = beatmap.Beatmap.HitObjects;
IEnumerable<HitObject> durationObjects = hitObjects.Where(d => d is IHasEndTime);
IEnumerable<HitObject> circles = hitObjects.Except(durationObjects);
IEnumerable<HitObject> sliders = hitObjects.Where(s => s is IHasCurve);
return new[]
{
Name = @"Circle Count",
Content = beatmap.Beatmap.HitObjects.Count(h => h is ConvertHit).ToString(),
Icon = FontAwesome.fa_dot_circle_o
},
new BeatmapStatistic
{
Name = @"Slider Count",
Content = beatmap.Beatmap.HitObjects.Count(h => h is ConvertSlider).ToString(),
Icon = FontAwesome.fa_circle_o
}
};
new BeatmapStatistic
{
Name = @"Circle Count",
Content = circles.Count().ToString(),
Icon = FontAwesome.fa_circle_o
},
new BeatmapStatistic
{
Name = @"Slider Count",
Content = sliders.Count().ToString(),
Icon = FontAwesome.fa_circle
}
};
}
public override IEnumerable<Mod> GetModsFor(ModType type)
{

View File

@ -11,7 +11,7 @@ using osu.Game.Beatmaps.ControlPoints;
namespace osu.Game.Rulesets.Objects.Legacy
{
public abstract class ConvertSlider : HitObject, IHasCurve
internal abstract class ConvertSlider : HitObject, IHasCurve
{
/// <summary>
/// Scoring distance with a speed-adjusted beat length of 1 second.

View File

@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
/// <summary>
/// Legacy osu! Hit-type, used for parsing Beatmaps.
/// </summary>
public sealed class ConvertHit : HitObject, IHasPosition, IHasCombo
internal sealed class ConvertHit : HitObject, IHasPosition, IHasCombo
{
public Vector2 Position { get; set; }

View File

@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
/// <summary>
/// Legacy osu! Slider-type, used for parsing Beatmaps.
/// </summary>
public sealed class ConvertSlider : Legacy.ConvertSlider, IHasPosition, IHasCombo
internal sealed class ConvertSlider : Legacy.ConvertSlider, IHasPosition, IHasCombo
{
public Vector2 Position { get; set; }

View File

@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
/// <summary>
/// Legacy osu! Spinner-type, used for parsing Beatmaps.
/// </summary>
public sealed class ConvertSpinner : HitObject, IHasEndTime, IHasPosition
internal sealed class ConvertSpinner : HitObject, IHasEndTime, IHasPosition
{
public double EndTime { get; set; }