Reorder params

This commit is contained in:
smoogipoo 2018-10-30 18:04:13 +09:00
parent 589c3a47e2
commit 76ea314c27
5 changed files with 18 additions and 18 deletions

View File

@ -164,16 +164,16 @@ namespace osu.Game.Rulesets.UI.Scrolling
switch (Direction.Value)
{
case ScrollingDirection.Up:
hitObject.Y = visualiser.PositionAt(currentTime, hitObject.HitObject.StartTime);
hitObject.Y = visualiser.PositionAt(hitObject.HitObject.StartTime, currentTime);
break;
case ScrollingDirection.Down:
hitObject.Y = -visualiser.PositionAt(currentTime, hitObject.HitObject.StartTime);
hitObject.Y = -visualiser.PositionAt(hitObject.HitObject.StartTime, currentTime);
break;
case ScrollingDirection.Left:
hitObject.X = visualiser.PositionAt(currentTime, hitObject.HitObject.StartTime);
hitObject.X = visualiser.PositionAt(hitObject.HitObject.StartTime, currentTime);
break;
case ScrollingDirection.Right:
hitObject.X = -visualiser.PositionAt(currentTime, hitObject.HitObject.StartTime);
hitObject.X = -visualiser.PositionAt(hitObject.HitObject.StartTime, currentTime);
break;
}
}

View File

@ -14,15 +14,15 @@ namespace osu.Game.Rulesets.UI.Scrolling.Visualisers
this.scrollLength = scrollLength;
}
public double GetDisplayStartTime(double startTime) => startTime - timeRange;
public double GetDisplayStartTime(double time) => time - timeRange;
public float GetLength(double startTime, double endTime)
{
// At the hitobject's end time, the hitobject will be positioned such that its end rests at the origin.
// This results in a negative-position value, and the absolute of it indicates the length of the hitobject.
return -PositionAt(endTime, startTime);
return -PositionAt(startTime, endTime);
}
public float PositionAt(double currentTime, double startTime) => (float)((startTime - currentTime) / timeRange * scrollLength);
public float PositionAt(double time, double currentTime) => (float)((time - currentTime) / timeRange * scrollLength);
}
}

View File

@ -5,10 +5,10 @@ namespace osu.Game.Rulesets.UI.Scrolling.Visualisers
{
public interface ISpeedChangeVisualiser
{
double GetDisplayStartTime(double startTime);
double GetDisplayStartTime(double time);
float GetLength(double startTime, double endTime);
float PositionAt(double currentTime, double startTime);
float PositionAt(double time, double currentTime);
}
}

View File

@ -23,22 +23,22 @@ namespace osu.Game.Rulesets.UI.Scrolling.Visualisers
searchPoint = new MultiplierControlPoint();
}
public double GetDisplayStartTime(double startTime)
public double GetDisplayStartTime(double time)
{
// The total amount of time that the hitobject will remain visible within the timeRange, which decreases as the speed multiplier increases
double visibleDuration = timeRange / controlPointAt(startTime).Multiplier;
return startTime - visibleDuration;
double visibleDuration = timeRange / controlPointAt(time).Multiplier;
return time - visibleDuration;
}
public float GetLength(double startTime, double endTime)
{
// At the hitobject's end time, the hitobject will be positioned such that its end rests at the origin.
// This results in a negative-position value, and the absolute of it indicates the length of the hitobject.
return -PositionAt(endTime, startTime);
return -PositionAt(startTime, endTime);
}
public float PositionAt(double currentTime, double startTime)
=> (float)((startTime - currentTime) / timeRange * controlPointAt(startTime).Multiplier * scrollLength);
public float PositionAt(double time, double currentTime)
=> (float)((time - currentTime) / timeRange * controlPointAt(time).Multiplier * scrollLength);
/// <summary>
/// Finds the <see cref="MultiplierControlPoint"/> which affects the speed of hitobjects at a specific time.

View File

@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.UI.Scrolling.Visualisers
positionCache = new Dictionary<double, double>();
}
public double GetDisplayStartTime(double startTime) => startTime - timeRange - 1000;
public double GetDisplayStartTime(double time) => time - timeRange - 1000;
public float GetLength(double startTime, double endTime)
{
@ -32,11 +32,11 @@ namespace osu.Game.Rulesets.UI.Scrolling.Visualisers
return (float)(objectLength * scrollLength);
}
public float PositionAt(double currentTime, double startTime)
public float PositionAt(double time, double currentTime)
{
// Caching is not used here as currentTime is unlikely to have been previously cached
double timelinePosition = relativePositionAt(currentTime);
return (float)((relativePositionAtCached(startTime) - timelinePosition) * scrollLength);
return (float)((relativePositionAtCached(time) - timelinePosition) * scrollLength);
}
private double relativePositionAtCached(double time)