Fix TestSceneFruitObjects

This commit is contained in:
ekrctb 2020-11-17 18:13:32 +09:00
parent eba17ecab2
commit eebce1f914
1 changed files with 49 additions and 12 deletions

View File

@ -6,6 +6,7 @@
using osu.Framework.Graphics;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Catch.Objects.Drawables;
using osu.Game.Rulesets.Objects;
using osuTK;
namespace osu.Game.Rulesets.Catch.Tests
@ -36,17 +37,29 @@ private Drawable createDrawableTinyDroplet()
Scale = 1.5f,
};
return new DrawableTinyDroplet(droplet)
return new TestDrawableTinyDroplet(droplet)
{
Anchor = Anchor.Centre,
RelativePositionAxes = Axes.None,
Position = Vector2.Zero,
Alpha = 1,
LifetimeStart = double.NegativeInfinity,
LifetimeEnd = double.PositiveInfinity,
};
}
private class TestDrawableTinyDroplet : DrawableTinyDroplet
{
public TestDrawableTinyDroplet(TinyDroplet tinyDroplet)
: base(tinyDroplet)
{
}
protected override void OnApply(HitObject hitObject)
{
base.OnApply(hitObject);
LifetimeStart = double.NegativeInfinity;
LifetimeEnd = double.PositiveInfinity;
}
}
private Drawable createDrawableDroplet(bool hyperdash = false)
{
var droplet = new TestCatchDroplet
@ -55,17 +68,29 @@ private Drawable createDrawableDroplet(bool hyperdash = false)
HyperDashTarget = hyperdash ? new Banana() : null
};
return new DrawableDroplet(droplet)
return new TestDrawableDroplet(droplet)
{
Anchor = Anchor.Centre,
RelativePositionAxes = Axes.None,
Position = Vector2.Zero,
Alpha = 1,
LifetimeStart = double.NegativeInfinity,
LifetimeEnd = double.PositiveInfinity,
};
}
private class TestDrawableDroplet : DrawableDroplet
{
public TestDrawableDroplet(Droplet droplet)
: base(droplet)
{
}
protected override void OnApply(HitObject hitObject)
{
base.OnApply(hitObject);
LifetimeStart = double.NegativeInfinity;
LifetimeEnd = double.PositiveInfinity;
}
}
private Drawable createDrawable(FruitVisualRepresentation rep, bool hyperdash = false)
{
Fruit fruit = new TestCatchFruit(rep)
@ -74,17 +99,29 @@ private Drawable createDrawable(FruitVisualRepresentation rep, bool hyperdash =
HyperDashTarget = hyperdash ? new Banana() : null
};
return new DrawableFruit(fruit)
return new TestDrawableFruit(fruit)
{
Anchor = Anchor.Centre,
RelativePositionAxes = Axes.None,
Position = Vector2.Zero,
Alpha = 1,
LifetimeStart = double.NegativeInfinity,
LifetimeEnd = double.PositiveInfinity,
};
}
private class TestDrawableFruit : DrawableFruit
{
public TestDrawableFruit(Fruit fruit)
: base(fruit)
{
}
protected override void OnApply(HitObject hitObject)
{
base.OnApply(hitObject);
LifetimeStart = double.NegativeInfinity;
LifetimeEnd = double.PositiveInfinity;
}
}
public class TestCatchFruit : Fruit
{
public TestCatchFruit(FruitVisualRepresentation rep)