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;
|
2017-04-21 19:29:27 +08:00
|
|
|
|
using System;
|
2017-03-15 11:57:17 +08:00
|
|
|
|
using System.Collections.Generic;
|
2017-04-21 19:29:27 +08:00
|
|
|
|
using OpenTK;
|
2017-04-21 15:18:34 +08:00
|
|
|
|
using osu.Game.Audio;
|
2017-05-29 11:10:29 +08:00
|
|
|
|
using osu.Game.Beatmaps.ControlPoints;
|
|
|
|
|
using osu.Game.Database;
|
2017-03-15 11:52:25 +08:00
|
|
|
|
|
2017-04-21 19:29:27 +08:00
|
|
|
|
namespace osu.Game.Rulesets.Objects.Legacy
|
2017-03-15 11:52:25 +08:00
|
|
|
|
{
|
2017-04-22 20:33:11 +08:00
|
|
|
|
internal abstract class ConvertSlider : HitObject, IHasCurve
|
2017-03-15 11:52:25 +08:00
|
|
|
|
{
|
2017-05-29 11:10:29 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Scoring distance with a speed-adjusted beat length of 1 second.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private const float base_scoring_distance = 100;
|
|
|
|
|
|
2017-04-22 19:43:20 +08:00
|
|
|
|
public List<Vector2> ControlPoints { get; set; }
|
|
|
|
|
public CurveType CurveType { get; set; }
|
2017-05-29 11:10:29 +08:00
|
|
|
|
|
2017-05-29 11:19:38 +08:00
|
|
|
|
public double Distance { get; set; }
|
2017-03-15 11:52:25 +08:00
|
|
|
|
|
2017-04-26 13:12:21 +08:00
|
|
|
|
public List<SampleInfoList> RepeatSamples { get; set; }
|
2017-04-21 19:29:27 +08:00
|
|
|
|
public int RepeatCount { get; set; } = 1;
|
2017-04-21 15:18:34 +08:00
|
|
|
|
|
2017-05-29 11:19:38 +08:00
|
|
|
|
public double EndTime => StartTime + RepeatCount * Distance / Velocity;
|
2017-05-29 11:10:29 +08:00
|
|
|
|
public double Duration => EndTime - StartTime;
|
|
|
|
|
|
2017-05-29 11:19:51 +08:00
|
|
|
|
public double Velocity = 1;
|
2017-04-21 19:29:27 +08:00
|
|
|
|
|
|
|
|
|
public Vector2 PositionAt(double progress)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
2017-03-15 11:52:25 +08:00
|
|
|
|
|
|
|
|
|
public double ProgressAt(double progress)
|
|
|
|
|
{
|
2017-04-21 19:29:27 +08:00
|
|
|
|
throw new NotImplementedException();
|
2017-03-15 11:52:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-04-21 19:29:27 +08:00
|
|
|
|
public int RepeatAt(double progress)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
2017-05-29 11:10:29 +08:00
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
2017-03-15 11:52:25 +08:00
|
|
|
|
}
|
|
|
|
|
}
|