Add xmldoc and clarify struct variables

This commit is contained in:
Dean Herbert 2019-03-11 14:36:29 +09:00
parent 2029cf93fd
commit 489153579a
3 changed files with 33 additions and 14 deletions

View File

@ -60,7 +60,7 @@ protected override void CreateNestedHitObjects()
// generate tiny droplets since the last point
if (lastEvent != null)
{
double sinceLastTick = e.StartTime - lastEvent.Value.StartTime;
double sinceLastTick = e.Time - lastEvent.Value.Time;
if (sinceLastTick > 80)
{
@ -73,7 +73,7 @@ protected override void CreateNestedHitObjects()
AddNested(new TinyDroplet
{
Samples = tickSamples,
StartTime = t + lastEvent.Value.StartTime,
StartTime = t + lastEvent.Value.Time,
X = X + Path.PositionAt(
lastEvent.Value.PathProgress + (t / sinceLastTick) * (e.PathProgress - lastEvent.Value.PathProgress)).X / CatchPlayfield.BASE_WIDTH,
});
@ -91,7 +91,7 @@ protected override void CreateNestedHitObjects()
AddNested(new Droplet
{
Samples = tickSamples,
StartTime = e.StartTime,
StartTime = e.Time,
X = X + Path.PositionAt(e.PathProgress).X / CatchPlayfield.BASE_WIDTH,
});
break;
@ -101,7 +101,7 @@ protected override void CreateNestedHitObjects()
AddNested(new Fruit
{
Samples = Samples,
StartTime = e.StartTime,
StartTime = e.Time,
X = X + Path.PositionAt(e.PathProgress).X / CatchPlayfield.BASE_WIDTH,
});
break;

View File

@ -176,7 +176,7 @@ protected override void CreateNestedHitObjects()
{
SpanIndex = e.SpanIndex,
SpanStartTime = e.SpanStartTime,
StartTime = e.StartTime,
StartTime = e.Time,
Position = Position + Path.PositionAt(e.PathProgress),
StackHeight = StackHeight,
Scale = Scale,
@ -186,7 +186,7 @@ protected override void CreateNestedHitObjects()
case SliderEventType.Head:
AddNested(HeadCircle = new SliderCircle
{
StartTime = e.StartTime,
StartTime = e.Time,
Position = Position,
Samples = getNodeSamples(0),
SampleControlPoint = SampleControlPoint,
@ -200,7 +200,7 @@ protected override void CreateNestedHitObjects()
// if this is to change, we should revisit this.
AddNested(TailCircle = new SliderTailCircle(this)
{
StartTime = e.StartTime,
StartTime = e.Time,
Position = EndPosition,
IndexInCurrentCombo = IndexInCurrentCombo,
ComboIndex = ComboIndex,

View File

@ -25,7 +25,7 @@ public static IEnumerable<SliderEventDescriptor> Generate(double startTime, doub
Type = SliderEventType.Head,
SpanIndex = 0,
SpanStartTime = startTime,
StartTime = startTime,
Time = startTime,
PathProgress = 0,
};
@ -49,7 +49,7 @@ public static IEnumerable<SliderEventDescriptor> Generate(double startTime, doub
Type = SliderEventType.Tick,
SpanIndex = span,
SpanStartTime = spanStartTime,
StartTime = spanStartTime + timeProgress * spanDuration,
Time = spanStartTime + timeProgress * spanDuration,
PathProgress = pathProgress,
};
}
@ -61,7 +61,7 @@ public static IEnumerable<SliderEventDescriptor> Generate(double startTime, doub
Type = SliderEventType.Repeat,
SpanIndex = span,
SpanStartTime = startTime + span * spanDuration,
StartTime = spanStartTime + spanDuration,
Time = spanStartTime + spanDuration,
PathProgress = (span + 1) % 2,
};
}
@ -90,7 +90,7 @@ public static IEnumerable<SliderEventDescriptor> Generate(double startTime, doub
Type = SliderEventType.LegacyLastTick,
SpanIndex = finalSpanIndex,
SpanStartTime = finalSpanStartTime,
StartTime = finalSpanEndTime,
Time = finalSpanEndTime,
PathProgress = finalProgress,
};
@ -99,22 +99,41 @@ public static IEnumerable<SliderEventDescriptor> Generate(double startTime, doub
Type = SliderEventType.Tail,
SpanIndex = finalSpanIndex,
SpanStartTime = startTime + (spanCount - 1) * spanDuration,
StartTime = startTime + totalDuration,
Time = startTime + totalDuration,
PathProgress = spanCount % 2,
};
}
}
/// <summary>
/// Describes a point in time on a slider given special meaning.
/// Should be used by rulesets to visualise the slider.
/// </summary>
public struct SliderEventDescriptor
{
/// <summary>
/// The type of event.
/// </summary>
public SliderEventType Type;
/// <summary>
/// The time of this event.
/// </summary>
public double Time;
/// <summary>
/// The zero-based index of the span. In the case of repeat sliders, this will increase each repeat.
/// </summary>
public int SpanIndex;
/// <summary>
/// The time at which the contained <see cref="SpanIndex"/> begins.
/// </summary>
public double SpanStartTime;
public double StartTime;
/// <summary>
/// The progress along the slider's <see cref="SliderPath"/> at which this event occurs.
/// </summary>
public double PathProgress;
}