mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 10:42:54 +08:00
Don't store beatmap reference in hitobjects.
This commit is contained in:
parent
c376f8436c
commit
187a8bbfa7
@ -4,14 +4,21 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Osu.Objects
|
namespace osu.Game.Modes.Osu.Objects
|
||||||
{
|
{
|
||||||
public class Slider : OsuHitObject
|
public class Slider : OsuHitObject
|
||||||
{
|
{
|
||||||
public override double EndTime => StartTime + RepeatCount * Curve.Length / VelocityAt(StartTime);
|
public override double EndTime => StartTime + RepeatCount * Curve.Length / Velocity;
|
||||||
|
|
||||||
public double VelocityAt(double time) => 100 / Beatmap.BeatLengthAt(time, true) * Beatmap.BeatmapInfo.BaseDifficulty.SliderMultiplier;
|
public double Velocity;
|
||||||
|
|
||||||
|
public override void SetDefaultsFromBeatmap(Beatmap beatmap)
|
||||||
|
{
|
||||||
|
Velocity = 100 / beatmap.BeatLengthAt(StartTime, true) * beatmap.BeatmapInfo.BaseDifficulty.SliderMultiplier;
|
||||||
|
}
|
||||||
|
|
||||||
public int RepeatCount;
|
public int RepeatCount;
|
||||||
|
|
||||||
|
@ -297,7 +297,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
|
|
||||||
if (obj != null)
|
if (obj != null)
|
||||||
{
|
{
|
||||||
obj.Beatmap = beatmap;
|
obj.SetDefaultsFromBeatmap(beatmap);
|
||||||
beatmap.HitObjects.Add(obj);
|
beatmap.HitObjects.Add(obj);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -21,8 +21,8 @@ namespace osu.Game.Modes.Objects
|
|||||||
|
|
||||||
public double Duration => EndTime - StartTime;
|
public double Duration => EndTime - StartTime;
|
||||||
|
|
||||||
public Beatmap Beatmap;
|
|
||||||
|
|
||||||
public HitSampleInfo Sample;
|
public HitSampleInfo Sample;
|
||||||
|
|
||||||
|
public virtual void SetDefaultsFromBeatmap(Beatmap beatmap) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user