mirror of
https://github.com/ppy/osu.git
synced 2024-12-16 00:52:59 +08:00
Merge pull request #494 from smoogipooo/beatmap_timinginfo
Replace List<ControlPoint> with TimingInfo in Beatmap.
This commit is contained in:
commit
296a3cd1e9
@ -48,7 +48,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
HitObjects = objects,
|
HitObjects = objects,
|
||||||
BeatmapInfo = new BeatmapInfo
|
BeatmapInfo = new BeatmapInfo
|
||||||
{
|
{
|
||||||
BaseDifficulty = new BaseDifficulty(),
|
Difficulty = new BeatmapDifficulty(),
|
||||||
Metadata = new BeatmapMetadata
|
Metadata = new BeatmapMetadata
|
||||||
{
|
{
|
||||||
Artist = @"Unknown",
|
Artist = @"Unknown",
|
||||||
|
@ -80,7 +80,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Mode = PlayMode.Osu,
|
Mode = PlayMode.Osu,
|
||||||
Path = "normal.osu",
|
Path = "normal.osu",
|
||||||
Version = "Normal",
|
Version = "Normal",
|
||||||
BaseDifficulty = new BaseDifficulty
|
Difficulty = new BeatmapDifficulty
|
||||||
{
|
{
|
||||||
OverallDifficulty = 3.5f,
|
OverallDifficulty = 3.5f,
|
||||||
}
|
}
|
||||||
@ -91,7 +91,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Mode = PlayMode.Osu,
|
Mode = PlayMode.Osu,
|
||||||
Path = "hard.osu",
|
Path = "hard.osu",
|
||||||
Version = "Hard",
|
Version = "Hard",
|
||||||
BaseDifficulty = new BaseDifficulty
|
Difficulty = new BeatmapDifficulty
|
||||||
{
|
{
|
||||||
OverallDifficulty = 5,
|
OverallDifficulty = 5,
|
||||||
}
|
}
|
||||||
@ -102,7 +102,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Mode = PlayMode.Osu,
|
Mode = PlayMode.Osu,
|
||||||
Path = "insane.osu",
|
Path = "insane.osu",
|
||||||
Version = "Insane",
|
Version = "Insane",
|
||||||
BaseDifficulty = new BaseDifficulty
|
Difficulty = new BeatmapDifficulty
|
||||||
{
|
{
|
||||||
OverallDifficulty = 7,
|
OverallDifficulty = 7,
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
HitObjects = objects,
|
HitObjects = objects,
|
||||||
BeatmapInfo = new BeatmapInfo
|
BeatmapInfo = new BeatmapInfo
|
||||||
{
|
{
|
||||||
BaseDifficulty = new BaseDifficulty(),
|
Difficulty = new BeatmapDifficulty(),
|
||||||
Metadata = new BeatmapMetadata
|
Metadata = new BeatmapMetadata
|
||||||
{
|
{
|
||||||
Artist = @"Unknown",
|
Artist = @"Unknown",
|
||||||
|
@ -69,7 +69,7 @@ namespace osu.Game.Modes.Osu.Objects
|
|||||||
|
|
||||||
public virtual void SetDefaultsFromBeatmap(Beatmap<OsuHitObject> beatmap)
|
public virtual void SetDefaultsFromBeatmap(Beatmap<OsuHitObject> beatmap)
|
||||||
{
|
{
|
||||||
Scale = (1.0f - 0.7f * (beatmap.BeatmapInfo.BaseDifficulty.CircleSize - 5) / 5) / 2;
|
Scale = (1.0f - 0.7f * (beatmap.BeatmapInfo.Difficulty.CircleSize - 5) / 5) / 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,10 +51,10 @@ namespace osu.Game.Modes.Osu.Objects
|
|||||||
{
|
{
|
||||||
base.SetDefaultsFromBeatmap(beatmap);
|
base.SetDefaultsFromBeatmap(beatmap);
|
||||||
|
|
||||||
var baseDifficulty = beatmap.BeatmapInfo.BaseDifficulty;
|
var baseDifficulty = beatmap.BeatmapInfo.Difficulty;
|
||||||
|
|
||||||
ControlPoint overridePoint;
|
ControlPoint overridePoint;
|
||||||
ControlPoint timingPoint = beatmap.TimingPointAt(StartTime, out overridePoint);
|
ControlPoint timingPoint = beatmap.TimingInfo.TimingPointAt(StartTime, out overridePoint);
|
||||||
var velocityAdjustment = overridePoint?.VelocityAdjustment ?? 1;
|
var velocityAdjustment = overridePoint?.VelocityAdjustment ?? 1;
|
||||||
var baseVelocity = 100 * baseDifficulty.SliderMultiplier / velocityAdjustment;
|
var baseVelocity = 100 * baseDifficulty.SliderMultiplier / velocityAdjustment;
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
using (var stream = Resource.OpenResource("Soleily - Renatus (Gamu) [Insane].osu"))
|
using (var stream = Resource.OpenResource("Soleily - Renatus (Gamu) [Insane].osu"))
|
||||||
{
|
{
|
||||||
var beatmap = decoder.Decode(new StreamReader(stream));
|
var beatmap = decoder.Decode(new StreamReader(stream));
|
||||||
var difficulty = beatmap.BeatmapInfo.BaseDifficulty;
|
var difficulty = beatmap.BeatmapInfo.Difficulty;
|
||||||
Assert.AreEqual(6.5f, difficulty.DrainRate);
|
Assert.AreEqual(6.5f, difficulty.DrainRate);
|
||||||
Assert.AreEqual(4, difficulty.CircleSize);
|
Assert.AreEqual(4, difficulty.CircleSize);
|
||||||
Assert.AreEqual(8, difficulty.OverallDifficulty);
|
Assert.AreEqual(8, difficulty.OverallDifficulty);
|
||||||
|
@ -7,7 +7,6 @@ using osu.Game.Database;
|
|||||||
using osu.Game.Modes;
|
using osu.Game.Modes;
|
||||||
using osu.Game.Modes.Objects;
|
using osu.Game.Modes.Objects;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace osu.Game.Beatmaps
|
namespace osu.Game.Beatmaps
|
||||||
{
|
{
|
||||||
@ -18,7 +17,7 @@ namespace osu.Game.Beatmaps
|
|||||||
where T : HitObject
|
where T : HitObject
|
||||||
{
|
{
|
||||||
public BeatmapInfo BeatmapInfo;
|
public BeatmapInfo BeatmapInfo;
|
||||||
public List<ControlPoint> ControlPoints;
|
public TimingInfo TimingInfo = new TimingInfo();
|
||||||
public readonly List<Color4> ComboColors = new List<Color4>
|
public readonly List<Color4> ComboColors = new List<Color4>
|
||||||
{
|
{
|
||||||
new Color4(17, 136, 170, 255),
|
new Color4(17, 136, 170, 255),
|
||||||
@ -41,49 +40,23 @@ namespace osu.Game.Beatmaps
|
|||||||
public Beatmap(Beatmap original = null)
|
public Beatmap(Beatmap original = null)
|
||||||
{
|
{
|
||||||
BeatmapInfo = original?.BeatmapInfo ?? BeatmapInfo;
|
BeatmapInfo = original?.BeatmapInfo ?? BeatmapInfo;
|
||||||
ControlPoints = original?.ControlPoints ?? ControlPoints;
|
TimingInfo = original?.TimingInfo ?? TimingInfo;
|
||||||
ComboColors = original?.ComboColors ?? ComboColors;
|
ComboColors = original?.ComboColors ?? ComboColors;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double BPMMaximum => 60000 / (ControlPoints?.Where(c => c.BeatLength != 0).OrderBy(c => c.BeatLength).FirstOrDefault() ?? ControlPoint.Default).BeatLength;
|
/// <summary>
|
||||||
public double BPMMinimum => 60000 / (ControlPoints?.Where(c => c.BeatLength != 0).OrderByDescending(c => c.BeatLength).FirstOrDefault() ?? ControlPoint.Default).BeatLength;
|
/// Finds the slider velocity at a time.
|
||||||
public double BPMMode => BPMAt(ControlPoints.Where(c => c.BeatLength != 0).GroupBy(c => c.BeatLength).OrderByDescending(grp => grp.Count()).First().First().Time);
|
/// </summary>
|
||||||
|
/// <param name="time">The time to find the slider velocity at.</param>
|
||||||
|
/// <returns>The slider velocity in positional length units.</returns>
|
||||||
|
public double SliderVelocityAt(double time)
|
||||||
|
{
|
||||||
|
double scoringDistance = 100 * BeatmapInfo.Difficulty.SliderMultiplier;
|
||||||
|
double beatDistance = TimingInfo.BeatDistanceAt(time);
|
||||||
|
|
||||||
public double BPMAt(double time)
|
if (beatDistance > 0)
|
||||||
{
|
return scoringDistance / beatDistance * 1000;
|
||||||
return 60000 / BeatLengthAt(time);
|
return scoringDistance;
|
||||||
}
|
|
||||||
|
|
||||||
public double BeatLengthAt(double time)
|
|
||||||
{
|
|
||||||
ControlPoint overridePoint;
|
|
||||||
ControlPoint timingPoint = TimingPointAt(time, out overridePoint);
|
|
||||||
return timingPoint.BeatLength;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ControlPoint TimingPointAt(double time, out ControlPoint overridePoint)
|
|
||||||
{
|
|
||||||
overridePoint = null;
|
|
||||||
|
|
||||||
ControlPoint timingPoint = null;
|
|
||||||
foreach (var controlPoint in ControlPoints)
|
|
||||||
{
|
|
||||||
// Some beatmaps have the first timingPoint (accidentally) start after the first HitObject(s).
|
|
||||||
// This null check makes it so that the first ControlPoint that makes a timing change is used as
|
|
||||||
// the timingPoint for those HitObject(s).
|
|
||||||
if (controlPoint.Time <= time || timingPoint == null)
|
|
||||||
{
|
|
||||||
if (controlPoint.TimingChange)
|
|
||||||
{
|
|
||||||
timingPoint = controlPoint;
|
|
||||||
overridePoint = null;
|
|
||||||
}
|
|
||||||
else overridePoint = controlPoint;
|
|
||||||
}
|
|
||||||
else break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return timingPoint ?? ControlPoint.Default;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using osu.Game.Modes.Objects;
|
using osu.Game.Modes.Objects;
|
||||||
using osu.Game.Beatmaps.Timing;
|
|
||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
|
|
||||||
namespace osu.Game.Beatmaps.Formats
|
namespace osu.Game.Beatmaps.Formats
|
||||||
@ -43,11 +42,10 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
var beatmap = new Beatmap
|
var beatmap = new Beatmap
|
||||||
{
|
{
|
||||||
HitObjects = new List<HitObject>(),
|
HitObjects = new List<HitObject>(),
|
||||||
ControlPoints = new List<ControlPoint>(),
|
|
||||||
BeatmapInfo = new BeatmapInfo
|
BeatmapInfo = new BeatmapInfo
|
||||||
{
|
{
|
||||||
Metadata = new BeatmapMetadata(),
|
Metadata = new BeatmapMetadata(),
|
||||||
BaseDifficulty = new BaseDifficulty(),
|
Difficulty = new BeatmapDifficulty(),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
ParseFile(stream, beatmap);
|
ParseFile(stream, beatmap);
|
||||||
|
@ -144,7 +144,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
|
|
||||||
private void handleDifficulty(Beatmap beatmap, string key, string val)
|
private void handleDifficulty(Beatmap beatmap, string key, string val)
|
||||||
{
|
{
|
||||||
var difficulty = beatmap.BeatmapInfo.BaseDifficulty;
|
var difficulty = beatmap.BeatmapInfo.Difficulty;
|
||||||
switch (key)
|
switch (key)
|
||||||
{
|
{
|
||||||
case @"HPDrainRate":
|
case @"HPDrainRate":
|
||||||
@ -209,7 +209,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cp != null)
|
if (cp != null)
|
||||||
beatmap.ControlPoints.Add(cp);
|
beatmap.TimingInfo.ControlPoints.Add(cp);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleColours(Beatmap beatmap, string key, string val, ref bool hasCustomColours)
|
private void handleColours(Beatmap beatmap, string key, string val, ref bool hasCustomColours)
|
||||||
|
106
osu.Game/Beatmaps/Timing/TimingInfo.cs
Normal file
106
osu.Game/Beatmaps/Timing/TimingInfo.cs
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps.Timing
|
||||||
|
{
|
||||||
|
public class TimingInfo
|
||||||
|
{
|
||||||
|
public readonly List<ControlPoint> ControlPoints = new List<ControlPoint>();
|
||||||
|
|
||||||
|
public double BPMMaximum => 60000 / (ControlPoints?.Where(c => c.BeatLength != 0).OrderBy(c => c.BeatLength).FirstOrDefault() ?? ControlPoint.Default).BeatLength;
|
||||||
|
public double BPMMinimum => 60000 / (ControlPoints?.Where(c => c.BeatLength != 0).OrderByDescending(c => c.BeatLength).FirstOrDefault() ?? ControlPoint.Default).BeatLength;
|
||||||
|
public double BPMMode => BPMAt(ControlPoints.Where(c => c.BeatLength != 0).GroupBy(c => c.BeatLength).OrderByDescending(grp => grp.Count()).First().First().Time);
|
||||||
|
|
||||||
|
public double BPMAt(double time)
|
||||||
|
{
|
||||||
|
return 60000 / BeatLengthAt(time);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Finds the BPM multiplier at a time.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="time">The time to find the BPM multiplier at.</param>
|
||||||
|
/// <returns>The BPM multiplier.</returns>
|
||||||
|
public double BPMMultiplierAt(double time)
|
||||||
|
{
|
||||||
|
ControlPoint overridePoint;
|
||||||
|
ControlPoint timingPoint = TimingPointAt(time, out overridePoint);
|
||||||
|
|
||||||
|
return overridePoint?.VelocityAdjustment ?? timingPoint?.VelocityAdjustment ?? 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Finds the beat length at a time.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="time">The time to find the beat length at.</param>
|
||||||
|
/// <returns>The beat length in milliseconds.</returns>
|
||||||
|
public double BeatLengthAt(double time)
|
||||||
|
{
|
||||||
|
ControlPoint overridePoint;
|
||||||
|
ControlPoint timingPoint = TimingPointAt(time, out overridePoint);
|
||||||
|
|
||||||
|
return timingPoint.BeatLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Finds the beat velocity at a time.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="time">The time to find the velocity at.</param>
|
||||||
|
/// <returns>The velocity.</returns>
|
||||||
|
public double BeatVelocityAt(double time)
|
||||||
|
{
|
||||||
|
ControlPoint overridePoint;
|
||||||
|
ControlPoint timingPoint = TimingPointAt(time, out overridePoint);
|
||||||
|
|
||||||
|
return overridePoint?.VelocityAdjustment ?? timingPoint?.VelocityAdjustment ?? 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Finds the beat length at a time.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="time">The time to find the beat length at.</param>
|
||||||
|
/// <returns>The beat length in positional length units.</returns>
|
||||||
|
public double BeatDistanceAt(double time)
|
||||||
|
{
|
||||||
|
ControlPoint overridePoint;
|
||||||
|
ControlPoint timingPoint = TimingPointAt(time, out overridePoint);
|
||||||
|
|
||||||
|
return (timingPoint?.BeatLength ?? 1) * (overridePoint?.VelocityAdjustment ?? timingPoint?.VelocityAdjustment ?? 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Finds the timing point at a time.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="time">The time to find the timing point at.</param>
|
||||||
|
/// <param name="overridePoint">The timing point containing the velocity change of the returned timing point.</param>
|
||||||
|
/// <returns>The timing point.</returns>
|
||||||
|
public ControlPoint TimingPointAt(double time, out ControlPoint overridePoint)
|
||||||
|
{
|
||||||
|
overridePoint = null;
|
||||||
|
|
||||||
|
ControlPoint timingPoint = null;
|
||||||
|
foreach (var controlPoint in ControlPoints)
|
||||||
|
{
|
||||||
|
// Some beatmaps have the first timingPoint (accidentally) start after the first HitObject(s).
|
||||||
|
// This null check makes it so that the first ControlPoint that makes a timing change is used as
|
||||||
|
// the timingPoint for those HitObject(s).
|
||||||
|
if (controlPoint.Time <= time || timingPoint == null)
|
||||||
|
{
|
||||||
|
if (controlPoint.TimingChange)
|
||||||
|
{
|
||||||
|
timingPoint = controlPoint;
|
||||||
|
overridePoint = null;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
overridePoint = controlPoint;
|
||||||
|
}
|
||||||
|
else break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return timingPoint ?? ControlPoint.Default;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -5,7 +5,7 @@ using SQLite.Net.Attributes;
|
|||||||
|
|
||||||
namespace osu.Game.Database
|
namespace osu.Game.Database
|
||||||
{
|
{
|
||||||
public class BaseDifficulty
|
public class BeatmapDifficulty
|
||||||
{
|
{
|
||||||
[PrimaryKey, AutoIncrement]
|
[PrimaryKey, AutoIncrement]
|
||||||
public int ID { get; set; }
|
public int ID { get; set; }
|
||||||
@ -15,6 +15,23 @@ namespace osu.Game.Database
|
|||||||
public float ApproachRate { get; set; }
|
public float ApproachRate { get; set; }
|
||||||
public float SliderMultiplier { get; set; }
|
public float SliderMultiplier { get; set; }
|
||||||
public float SliderTickRate { get; set; }
|
public float SliderTickRate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Maps a difficulty value [0, 10] to a two-piece linear range of values.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="difficulty">The difficulty value to be mapped.</param>
|
||||||
|
/// <param name="min">Minimum of the resulting range which will be achieved by a difficulty value of 0.</param>
|
||||||
|
/// <param name="mid">Midpoint of the resulting range which will be achieved by a difficulty value of 5.</param>
|
||||||
|
/// <param name="max">Maximum of the resulting range which will be achieved by a difficulty value of 10.</param>
|
||||||
|
/// <returns>Value to which the difficulty value maps in the specified range.</returns>
|
||||||
|
public static double DifficultyRange(double difficulty, double min, double mid, double max)
|
||||||
|
{
|
||||||
|
if (difficulty > 5)
|
||||||
|
return mid + (max - mid) * (difficulty - 5) / 5;
|
||||||
|
if (difficulty < 5)
|
||||||
|
return mid - (mid - min) * (5 - difficulty) / 5;
|
||||||
|
return mid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ namespace osu.Game.Database
|
|||||||
foreach (var i in b.Beatmaps)
|
foreach (var i in b.Beatmaps)
|
||||||
{
|
{
|
||||||
if (i.Metadata != null) connection.Delete(i.Metadata);
|
if (i.Metadata != null) connection.Delete(i.Metadata);
|
||||||
if (i.BaseDifficulty != null) connection.Delete(i.BaseDifficulty);
|
if (i.Difficulty != null) connection.Delete(i.Difficulty);
|
||||||
|
|
||||||
connection.Delete(i);
|
connection.Delete(i);
|
||||||
}
|
}
|
||||||
@ -90,7 +90,7 @@ namespace osu.Game.Database
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
conn.CreateTable<BeatmapMetadata>();
|
conn.CreateTable<BeatmapMetadata>();
|
||||||
conn.CreateTable<BaseDifficulty>();
|
conn.CreateTable<BeatmapDifficulty>();
|
||||||
conn.CreateTable<BeatmapSetInfo>();
|
conn.CreateTable<BeatmapSetInfo>();
|
||||||
conn.CreateTable<BeatmapInfo>();
|
conn.CreateTable<BeatmapInfo>();
|
||||||
}
|
}
|
||||||
@ -112,7 +112,7 @@ namespace osu.Game.Database
|
|||||||
}
|
}
|
||||||
|
|
||||||
connection.DeleteAll<BeatmapMetadata>();
|
connection.DeleteAll<BeatmapMetadata>();
|
||||||
connection.DeleteAll<BaseDifficulty>();
|
connection.DeleteAll<BeatmapDifficulty>();
|
||||||
connection.DeleteAll<BeatmapSetInfo>();
|
connection.DeleteAll<BeatmapSetInfo>();
|
||||||
connection.DeleteAll<BeatmapInfo>();
|
connection.DeleteAll<BeatmapInfo>();
|
||||||
}
|
}
|
||||||
@ -329,7 +329,7 @@ namespace osu.Game.Database
|
|||||||
typeof(BeatmapSetInfo),
|
typeof(BeatmapSetInfo),
|
||||||
typeof(BeatmapInfo),
|
typeof(BeatmapInfo),
|
||||||
typeof(BeatmapMetadata),
|
typeof(BeatmapMetadata),
|
||||||
typeof(BaseDifficulty),
|
typeof(BeatmapDifficulty),
|
||||||
};
|
};
|
||||||
|
|
||||||
public void Update<T>(T record, bool cascade = true) where T : class
|
public void Update<T>(T record, bool cascade = true) where T : class
|
||||||
|
@ -31,11 +31,11 @@ namespace osu.Game.Database
|
|||||||
[OneToOne(CascadeOperations = CascadeOperation.All)]
|
[OneToOne(CascadeOperations = CascadeOperation.All)]
|
||||||
public BeatmapMetadata Metadata { get; set; }
|
public BeatmapMetadata Metadata { get; set; }
|
||||||
|
|
||||||
[ForeignKey(typeof(BaseDifficulty)), NotNull]
|
[ForeignKey(typeof(BeatmapDifficulty)), NotNull]
|
||||||
public int BaseDifficultyID { get; set; }
|
public int BaseDifficultyID { get; set; }
|
||||||
|
|
||||||
[OneToOne(CascadeOperations = CascadeOperation.All)]
|
[OneToOne(CascadeOperations = CascadeOperation.All)]
|
||||||
public BaseDifficulty BaseDifficulty { get; set; }
|
public BeatmapDifficulty Difficulty { get; set; }
|
||||||
|
|
||||||
public string Path { get; set; }
|
public string Path { get; set; }
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ namespace osu.Game.Database
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return starDifficulty < 0 ? (BaseDifficulty?.OverallDifficulty ?? 5) : starDifficulty;
|
return starDifficulty < 0 ? (Difficulty?.OverallDifficulty ?? 5) : starDifficulty;
|
||||||
}
|
}
|
||||||
|
|
||||||
set { starDifficulty = value; }
|
set { starDifficulty = value; }
|
||||||
|
@ -217,12 +217,12 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
private string getBPMRange(Beatmap beatmap)
|
private string getBPMRange(Beatmap beatmap)
|
||||||
{
|
{
|
||||||
double bpmMax = beatmap.BPMMaximum;
|
double bpmMax = beatmap.TimingInfo.BPMMaximum;
|
||||||
double bpmMin = beatmap.BPMMinimum;
|
double bpmMin = beatmap.TimingInfo.BPMMinimum;
|
||||||
|
|
||||||
if (Precision.AlmostEquals(bpmMin, bpmMax)) return Math.Round(bpmMin) + "bpm";
|
if (Precision.AlmostEquals(bpmMin, bpmMax)) return Math.Round(bpmMin) + "bpm";
|
||||||
|
|
||||||
return Math.Round(bpmMin) + "-" + Math.Round(bpmMax) + "bpm (mostly " + Math.Round(beatmap.BPMMode) + "bpm)";
|
return Math.Round(bpmMin) + "-" + Math.Round(bpmMax) + "bpm (mostly " + Math.Round(beatmap.TimingInfo.BPMMode) + "bpm)";
|
||||||
}
|
}
|
||||||
|
|
||||||
public class InfoLabel : Container
|
public class InfoLabel : Container
|
||||||
|
@ -75,6 +75,7 @@
|
|||||||
<Compile Include="Beatmaps\DifficultyCalculator.cs" />
|
<Compile Include="Beatmaps\DifficultyCalculator.cs" />
|
||||||
<Compile Include="Beatmaps\IBeatmapCoverter.cs" />
|
<Compile Include="Beatmaps\IBeatmapCoverter.cs" />
|
||||||
<Compile Include="Beatmaps\IBeatmapProcessor.cs" />
|
<Compile Include="Beatmaps\IBeatmapProcessor.cs" />
|
||||||
|
<Compile Include="Beatmaps\Timing\TimingInfo.cs" />
|
||||||
<Compile Include="Database\ScoreDatabase.cs" />
|
<Compile Include="Database\ScoreDatabase.cs" />
|
||||||
<Compile Include="Graphics\Backgrounds\Triangles.cs" />
|
<Compile Include="Graphics\Backgrounds\Triangles.cs" />
|
||||||
<Compile Include="Graphics\Cursor\CursorTrail.cs" />
|
<Compile Include="Graphics\Cursor\CursorTrail.cs" />
|
||||||
|
Loading…
Reference in New Issue
Block a user