2017-02-07 12:59:30 +08:00
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
2016-08-31 11:33:01 +08:00
|
|
|
|
2017-03-12 13:32:50 +08:00
|
|
|
using OpenTK.Graphics;
|
2016-08-31 12:51:00 +08:00
|
|
|
using osu.Game.Beatmaps.Timing;
|
2017-03-12 13:32:50 +08:00
|
|
|
using osu.Game.Database;
|
2017-02-25 02:36:17 +08:00
|
|
|
using osu.Game.Modes;
|
2017-03-11 23:34:21 +08:00
|
|
|
using osu.Game.Modes.Objects;
|
|
|
|
using System.Collections.Generic;
|
2016-08-31 11:33:01 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Beatmaps
|
|
|
|
{
|
2017-03-11 23:34:21 +08:00
|
|
|
/// <summary>
|
2017-03-12 13:32:50 +08:00
|
|
|
/// A Beatmap containing converted HitObjects.
|
2017-03-11 23:34:21 +08:00
|
|
|
/// </summary>
|
2017-03-12 13:32:50 +08:00
|
|
|
public class Beatmap<T>
|
2017-03-11 23:34:21 +08:00
|
|
|
where T : HitObject
|
|
|
|
{
|
2017-03-12 13:32:50 +08:00
|
|
|
public BeatmapInfo BeatmapInfo;
|
2017-03-16 16:11:24 +08:00
|
|
|
public TimingInfo TimingInfo = new TimingInfo();
|
2017-03-14 16:14:11 +08:00
|
|
|
public readonly List<Color4> ComboColors = new List<Color4>
|
2017-03-14 16:01:21 +08:00
|
|
|
{
|
|
|
|
new Color4(17, 136, 170, 255),
|
|
|
|
new Color4(102, 136, 0, 255),
|
|
|
|
new Color4(204, 102, 0, 255),
|
|
|
|
new Color4(121, 9, 13, 255)
|
|
|
|
};
|
2017-03-12 13:32:50 +08:00
|
|
|
|
|
|
|
public BeatmapMetadata Metadata => BeatmapInfo?.Metadata ?? BeatmapInfo?.BeatmapSet?.Metadata;
|
|
|
|
|
2017-03-12 00:08:34 +08:00
|
|
|
/// <summary>
|
|
|
|
/// The HitObjects this Beatmap contains.
|
|
|
|
/// </summary>
|
2017-03-11 23:34:21 +08:00
|
|
|
public List<T> HitObjects;
|
|
|
|
|
2017-03-12 00:08:34 +08:00
|
|
|
/// <summary>
|
2017-03-12 13:32:50 +08:00
|
|
|
/// Constructs a new beatmap.
|
2017-03-12 00:08:34 +08:00
|
|
|
/// </summary>
|
2017-03-12 13:32:50 +08:00
|
|
|
/// <param name="original">The original beatmap to use the parameters of.</param>
|
|
|
|
public Beatmap(Beatmap original = null)
|
2017-03-11 23:34:21 +08:00
|
|
|
{
|
2017-03-14 16:01:21 +08:00
|
|
|
BeatmapInfo = original?.BeatmapInfo ?? BeatmapInfo;
|
2017-03-16 16:11:24 +08:00
|
|
|
TimingInfo = original?.TimingInfo ?? TimingInfo;
|
2017-03-14 16:01:21 +08:00
|
|
|
ComboColors = original?.ComboColors ?? ComboColors;
|
2017-03-11 23:34:21 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-12 00:08:34 +08:00
|
|
|
/// <summary>
|
|
|
|
/// A Beatmap containing un-converted HitObjects.
|
|
|
|
/// </summary>
|
2017-03-11 23:34:21 +08:00
|
|
|
public class Beatmap : Beatmap<HitObject>
|
|
|
|
{
|
2017-03-12 00:08:34 +08:00
|
|
|
/// <summary>
|
|
|
|
/// Calculates the star difficulty for this Beatmap.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>The star difficulty.</returns>
|
2017-02-25 02:36:17 +08:00
|
|
|
public double CalculateStarDifficulty() => Ruleset.GetRuleset(BeatmapInfo.Mode).CreateDifficultyCalculator(this).Calculate();
|
2017-03-17 13:24:46 +08:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Constructs a new beatmap.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="original">The original beatmap to use the parameters of.</param>
|
|
|
|
public Beatmap(Beatmap original = null)
|
|
|
|
: base(original)
|
|
|
|
{
|
|
|
|
}
|
2016-08-31 11:33:01 +08:00
|
|
|
}
|
2016-10-19 22:31:10 +08:00
|
|
|
}
|