1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-24 12:47:24 +08:00
osu-lazer/osu.Game/Rulesets/Objects/Legacy/ConvertSlider.cs

62 lines
2.0 KiB
C#
Raw Normal View History

2017-03-15 11:57:17 +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
2017-04-18 15:05:58 +08:00
using osu.Game.Rulesets.Objects.Types;
using System;
2017-03-15 11:57:17 +08:00
using System.Collections.Generic;
using OpenTK;
using osu.Game.Audio;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Database;
namespace osu.Game.Rulesets.Objects.Legacy
{
internal abstract class ConvertSlider : HitObject, IHasCurve
{
/// <summary>
/// Scoring distance with a speed-adjusted beat length of 1 second.
/// </summary>
private const float base_scoring_distance = 100;
public List<Vector2> ControlPoints { get; set; }
public CurveType CurveType { get; set; }
2017-05-29 11:19:38 +08:00
public double Distance { get; set; }
public List<SampleInfoList> RepeatSamples { get; set; }
public int RepeatCount { get; set; } = 1;
2017-05-29 11:19:38 +08:00
public double EndTime => StartTime + RepeatCount * Distance / Velocity;
public double Duration => EndTime - StartTime;
public double Velocity;
public Vector2 PositionAt(double progress)
{
throw new NotImplementedException();
}
public double ProgressAt(double progress)
{
throw new NotImplementedException();
}
public int RepeatAt(double progress)
{
throw new NotImplementedException();
}
public override void ApplyDefaults(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
{
base.ApplyDefaults(controlPointInfo, difficulty);
TimingControlPoint timingPoint = controlPointInfo.TimingPointAt(StartTime);
DifficultyControlPoint difficultyPoint = controlPointInfo.DifficultyPointAt(StartTime);
double scoringDistance = base_scoring_distance * difficulty.SliderMultiplier / difficultyPoint.SpeedMultiplier;
Velocity = scoringDistance / timingPoint.BeatLength;
}
}
}