mirror of https://github.com/ppy/osu
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 osu.Game.Database;
|
||||
using OpenTK;
|
||||
using osu.Game.Beatmaps;
|
||||
using System;
|
||||
|
||||
namespace osu.Game.Modes.Osu.Objects
|
||||
{
|
||||
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;
|
||||
|
||||
|
|
|
@ -297,7 +297,7 @@ protected override Beatmap ParseFile(TextReader stream)
|
|||
|
||||
if (obj != null)
|
||||
{
|
||||
obj.Beatmap = beatmap;
|
||||
obj.SetDefaultsFromBeatmap(beatmap);
|
||||
beatmap.HitObjects.Add(obj);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -21,8 +21,8 @@ public abstract class HitObject
|
|||
|
||||
public double Duration => EndTime - StartTime;
|
||||
|
||||
public Beatmap Beatmap;
|
||||
|
||||
public HitSampleInfo Sample;
|
||||
|
||||
public virtual void SetDefaultsFromBeatmap(Beatmap beatmap) { }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue