2019-01-24 16:43:03 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Game.Rulesets.Catch.Objects;
|
|
|
|
|
using osu.Game.Rulesets.Catch.Objects.Drawable;
|
|
|
|
|
using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces;
|
|
|
|
|
using osu.Game.Tests.Visual;
|
2018-11-20 15:51:59 +08:00
|
|
|
|
using osuTK;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Catch.Tests
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
2019-05-15 03:37:25 +08:00
|
|
|
|
public class TestSceneFruitObjects : OsuTestScene
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
|
|
|
|
{
|
|
|
|
|
typeof(CatchHitObject),
|
|
|
|
|
typeof(Fruit),
|
|
|
|
|
typeof(Droplet),
|
|
|
|
|
typeof(DrawableCatchHitObject),
|
|
|
|
|
typeof(DrawableFruit),
|
|
|
|
|
typeof(DrawableDroplet),
|
2018-05-25 16:32:22 +08:00
|
|
|
|
typeof(BananaShower),
|
2018-04-13 17:19:50 +08:00
|
|
|
|
typeof(Pulp),
|
|
|
|
|
};
|
|
|
|
|
|
2019-05-15 03:37:25 +08:00
|
|
|
|
public TestSceneFruitObjects()
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
Add(new GridContainer
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Content = new[]
|
|
|
|
|
{
|
|
|
|
|
new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
createDrawable(0),
|
|
|
|
|
createDrawable(1),
|
|
|
|
|
createDrawable(2),
|
|
|
|
|
},
|
|
|
|
|
new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
createDrawable(3),
|
|
|
|
|
createDrawable(4),
|
|
|
|
|
createDrawable(5),
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private DrawableFruit createDrawable(int index)
|
|
|
|
|
{
|
2018-05-25 16:32:22 +08:00
|
|
|
|
Fruit fruit = index == 5
|
2018-06-12 03:43:01 +08:00
|
|
|
|
? new Banana
|
2018-05-25 16:32:22 +08:00
|
|
|
|
{
|
|
|
|
|
StartTime = 1000000000000,
|
2020-02-17 15:40:18 +08:00
|
|
|
|
ComboIndex = index,
|
2018-05-25 16:32:22 +08:00
|
|
|
|
Scale = 1.5f,
|
|
|
|
|
}
|
|
|
|
|
: new Fruit
|
|
|
|
|
{
|
|
|
|
|
StartTime = 1000000000000,
|
2020-02-17 15:40:18 +08:00
|
|
|
|
ComboIndex = index,
|
2018-05-25 16:32:22 +08:00
|
|
|
|
Scale = 1.5f,
|
|
|
|
|
};
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
return new DrawableFruit(fruit)
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
RelativePositionAxes = Axes.Both,
|
|
|
|
|
Position = Vector2.Zero,
|
|
|
|
|
Alpha = 1,
|
|
|
|
|
LifetimeStart = double.NegativeInfinity,
|
|
|
|
|
LifetimeEnd = double.PositiveInfinity,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|