2019-01-24 08:43:03 +00:00
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2018-04-13 09:19:50 +00:00
2018-01-03 09:44:25 +00:00
using System.Collections.Generic ;
using System.Linq ;
using osu.Game.Beatmaps ;
using osu.Game.Rulesets.Mania.Objects ;
using osu.Game.Rulesets.Mania.UI ;
2018-04-13 09:19:50 +00:00
2018-01-03 09:44:25 +00:00
namespace osu.Game.Rulesets.Mania.Beatmaps
{
public class ManiaBeatmap : Beatmap < ManiaHitObject >
{
/// <summary>
2018-01-03 10:13:42 +00:00
/// The definitions for each stage in a <see cref="ManiaPlayfield"/>.
2018-01-03 09:44:25 +00:00
/// </summary>
2018-01-15 06:49:03 +00:00
public List < StageDefinition > Stages = new List < StageDefinition > ( ) ;
2018-04-13 09:19:50 +00:00
2018-01-03 09:44:25 +00:00
/// <summary>
2018-01-03 10:13:42 +00:00
/// Total number of columns represented by all stages in this <see cref="ManiaBeatmap"/>.
2018-01-03 09:44:25 +00:00
/// </summary>
2018-01-03 10:13:42 +00:00
public int TotalColumns = > Stages . Sum ( g = > g . Columns ) ;
2018-04-13 09:19:50 +00:00
2020-10-14 08:53:28 +00:00
/// <summary>
/// The total number of columns that were present in this <see cref="ManiaBeatmap"/> before any user adjustments.
/// </summary>
public readonly int OriginalTotalColumns ;
2018-01-03 09:44:25 +00:00
/// <summary>
/// Creates a new <see cref="ManiaBeatmap"/>.
/// </summary>
2018-01-15 06:49:03 +00:00
/// <param name="defaultStage">The initial stages.</param>
2020-10-14 08:53:28 +00:00
/// <param name="originalTotalColumns">The total number of columns present before any user adjustments. Defaults to the total columns in <paramref name="defaultStage"/>.</param>
public ManiaBeatmap ( StageDefinition defaultStage , int? originalTotalColumns = null )
2018-01-03 09:44:25 +00:00
{
2018-01-15 06:49:03 +00:00
Stages . Add ( defaultStage ) ;
2020-10-14 08:53:28 +00:00
OriginalTotalColumns = originalTotalColumns ? ? defaultStage . Columns ;
2018-01-03 09:44:25 +00:00
}
2018-05-07 01:58:56 +00:00
public override IEnumerable < BeatmapStatistic > GetStatistics ( )
{
2018-05-07 02:33:05 +00:00
int notes = HitObjects . Count ( s = > s is Note ) ;
2021-12-10 05:15:00 +00:00
int holdNotes = HitObjects . Count ( s = > s is HoldNote ) ;
2018-05-07 01:58:56 +00:00
return new [ ]
{
new BeatmapStatistic
{
Name = @"Note Count" ,
2020-09-04 06:01:32 +00:00
CreateIcon = ( ) = > new BeatmapStatisticIcon ( BeatmapStatisticsIconType . Circles ) ,
2018-05-07 01:58:56 +00:00
Content = notes . ToString ( ) ,
} ,
new BeatmapStatistic
{
Name = @"Hold Note Count" ,
2020-09-04 06:01:32 +00:00
CreateIcon = ( ) = > new BeatmapStatisticIcon ( BeatmapStatisticsIconType . Sliders ) ,
2021-12-10 05:15:00 +00:00
Content = holdNotes . ToString ( ) ,
2018-05-07 01:58:56 +00:00
} ,
} ;
}
2018-01-03 09:44:25 +00:00
}
}