1
0
mirror of https://github.com/ppy/osu.git synced 2024-10-01 07:17:27 +08:00
osu-lazer/osu.Game.Rulesets.Catch.Tests/TestCaseFruitObjects.cs

75 lines
2.2 KiB
C#
Raw Normal View History

2018-01-09 21:24:12 +08:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
2018-01-04 14:21:33 +08:00
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
2018-01-03 15:32:09 +08:00
using System;
using System.Collections.Generic;
2018-03-02 14:34:31 +08:00
using NUnit.Framework;
2018-01-03 15:32:09 +08:00
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
{
2018-03-02 14:34:31 +08:00
[TestFixture]
2018-01-03 15:32:09 +08:00
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
},
}
});
}
2018-01-03 19:52:01 +08:00
private DrawableFruit createDrawable(int index)
2018-01-03 15:32:09 +08:00
{
2018-01-03 19:52:01 +08:00
var fruit = new Fruit
{
StartTime = 1000000000000,
IndexInBeatmap = index,
Scale = 1.5f,
};
return new DrawableFruit(fruit)
{
Anchor = Anchor.Centre,
RelativePositionAxes = Axes.Both,
Position = Vector2.Zero,
Alpha = 1,
LifetimeStart = double.NegativeInfinity,
LifetimeEnd = double.PositiveInfinity,
};
}
2018-01-03 15:32:09 +08:00
}
}