address review

This commit is contained in:
Shawdooow
2017-09-27 11:28:44 -04:00
parent 4e8944de04
commit cfb1804aa1
6 changed files with 27 additions and 29 deletions

View File

@ -10,9 +10,9 @@ using osu.Game.Rulesets.Osu.Judgements;
namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
public class DrawableSliderBouncer : DrawableOsuHitObject
public class DrawableRepeatPoint : DrawableOsuHitObject
{
private readonly SliderBouncer sliderBouncer;
private readonly RepeatPoint repeatPoint;
private readonly DrawableSlider drawableSlider;
public double FadeInTime;
@ -20,9 +20,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
public override bool RemoveWhenNotAlive => false;
public DrawableSliderBouncer(SliderBouncer sliderBouncer, DrawableSlider drawableSlider) : base(sliderBouncer)
public DrawableRepeatPoint(RepeatPoint repeatPoint, DrawableSlider drawableSlider) : base(repeatPoint)
{
this.sliderBouncer = sliderBouncer;
this.repeatPoint = repeatPoint;
this.drawableSlider = drawableSlider;
AutoSizeAxes = Axes.Both;
@ -43,13 +43,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
{
if (sliderBouncer.StartTime <= Time.Current)
if (repeatPoint.StartTime <= Time.Current)
AddJudgement(new OsuJudgement { Result = drawableSlider.Tracking ? HitResult.Great : HitResult.Miss });
}
protected override void UpdatePreemptState()
{
var animIn = Math.Min(150, sliderBouncer.StartTime - FadeInTime);
var animIn = Math.Min(150, repeatPoint.StartTime - FadeInTime);
this.Animate(
d => d.FadeIn(animIn),
@ -64,7 +64,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
switch (state)
{
case ArmedState.Idle:
this.Delay(FadeOutTime - sliderBouncer.StartTime).FadeOut();
this.Delay(FadeOutTime - repeatPoint.StartTime).FadeOut();
break;
case ArmedState.Miss:
this.FadeOut(160);

View File

@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
private readonly List<ISliderProgress> components = new List<ISliderProgress>();
private readonly Container<DrawableSliderTick> ticks;
private readonly Container<DrawableSliderBouncer> bouncers;
private readonly Container<DrawableRepeatPoint> repeatPoints;
private readonly SliderBody body;
private readonly SliderBall ball;
@ -39,7 +39,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
PathWidth = s.Scale * 64,
},
ticks = new Container<DrawableSliderTick>(),
bouncers = new Container<DrawableSliderBouncer>(),
repeatPoints = new Container<DrawableRepeatPoint>(),
ball = new SliderBall(s)
{
Scale = new Vector2(s.Scale),
@ -80,21 +80,21 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
AddNested(drawableTick);
}
foreach (var bouncer in s.Bouncers)
foreach (var repeatPoint in s.RepeatPoints)
{
var repeatStartTime = s.StartTime + bouncer.RepeatIndex * repeatDuration;
var fadeInTime = repeatStartTime + (bouncer.StartTime - repeatStartTime) / 2 - (bouncer.RepeatIndex == 0 ? TIME_FADEIN : TIME_FADEIN / 2);
var repeatStartTime = s.StartTime + repeatPoint.RepeatIndex * repeatDuration;
var fadeInTime = repeatStartTime + (repeatPoint.StartTime - repeatStartTime) / 2 - (repeatPoint.RepeatIndex == 0 ? TIME_FADEIN : TIME_FADEIN / 2);
var fadeOutTime = repeatStartTime + repeatDuration;
var drawableBouncer = new DrawableSliderBouncer(bouncer, this)
var drawableRepeatPoint = new DrawableRepeatPoint(repeatPoint, this)
{
FadeInTime = fadeInTime,
FadeOutTime = fadeOutTime,
Position = bouncer.Position,
Position = repeatPoint.Position,
};
bouncers.Add(drawableBouncer);
AddNested(drawableBouncer);
repeatPoints.Add(drawableRepeatPoint);
AddNested(drawableRepeatPoint);
}
}
@ -131,8 +131,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
if (!userTriggered && Time.Current >= slider.EndTime)
{
var judgementsCount = ticks.Children.Count + bouncers.Children.Count + 1;
var judgementsHit = ticks.Children.Count(t => t.Judgements.Any(j => j.IsHit)) + bouncers.Children.Count(t => t.Judgements.Any(j => j.IsHit));
var judgementsCount = ticks.Children.Count + repeatPoints.Children.Count + 1;
var judgementsHit = ticks.Children.Count(t => t.Judgements.Any(j => j.IsHit)) + repeatPoints.Children.Count(t => t.Judgements.Any(j => j.IsHit));
if (initialCircle.Judgements.Any(j => j.IsHit))
judgementsHit++;