1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-19 18:42:54 +08:00
osu-lazer/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs

68 lines
2.0 KiB
C#
Raw Normal View History

2018-01-03 15:32:09 +08:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System;
using System.Collections.Generic;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Catch.Objects.Drawable;
2018-01-03 17:26:54 +08:00
using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces;
2018-01-03 15:32:09 +08:00
using osu.Game.Tests.Visual;
using OpenTK;
namespace osu.Game.Rulesets.Catch.Tests
{
public class TestCaseFruitObjects : OsuTestCase
{
public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(CatchHitObject),
typeof(Fruit),
2018-01-03 17:26:54 +08:00
typeof(Droplet),
2018-01-03 15:32:09 +08:00
typeof(DrawableCatchHitObject),
typeof(DrawableFruit),
2018-01-03 17:26:54 +08:00
typeof(DrawableDroplet),
typeof(Pulp),
2018-01-03 15:32:09 +08:00
};
public TestCaseFruitObjects()
{
Add(new GridContainer
{
RelativeSizeAxes = Axes.Both,
Content = new[]
{
new Drawable[]
{
createDrawable(0),
createDrawable(1),
2018-01-03 17:26:54 +08:00
createDrawable(2),
2018-01-03 15:32:09 +08:00
},
new Drawable[]
{
createDrawable(3),
2018-01-03 17:26:54 +08:00
createDrawable(4),
createDrawable(5),
2018-01-03 15:32:09 +08:00
},
}
});
}
private DrawableFruit createDrawable(int index) => new DrawableFruit(new Fruit
{
2018-01-03 17:26:54 +08:00
StartTime = 1000000000000,
IndexInBeatmap = index,
Scale = 1.5f,
2018-01-03 15:32:09 +08:00
})
{
Anchor = Anchor.Centre,
RelativePositionAxes = Axes.Both,
Position = Vector2.Zero,
Alpha = 1,
LifetimeStart = double.NegativeInfinity,
LifetimeEnd = double.PositiveInfinity,
};
}
}