osu/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs

122 lines
3.4 KiB
C#
Raw Normal View History

2017-03-20 08:02:06 +00:00
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Linq;
2017-03-20 08:02:06 +00:00
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Graphics.Containers;
2017-03-28 12:03:34 +00:00
using osu.Framework.Testing;
2017-04-18 07:05:58 +00:00
using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces;
2017-03-17 13:01:06 +00:00
namespace osu.Desktop.VisualTests.Tests
{
internal class TestCaseTaikoHitObjects : TestCase
{
public override string Description => "Taiko hit objects";
private bool kiai;
2017-03-17 13:01:06 +00:00
public override void Reset()
{
base.Reset();
2017-03-31 08:55:07 +00:00
AddToggleStep("Kiai", b =>
{
kiai = !kiai;
updateKiaiState();
});
Add(new CirclePiece
{
Position = new Vector2(100, 100),
AccentColour = Color4.DarkRed,
KiaiMode = kiai,
Children = new[]
{
new CentreHitSymbolPiece()
}
2017-03-20 06:07:42 +00:00
});
Add(new CirclePiece(true)
{
Position = new Vector2(350, 100),
AccentColour = Color4.DarkRed,
KiaiMode = kiai,
Children = new[]
{
new CentreHitSymbolPiece()
}
2017-03-17 13:01:06 +00:00
});
Add(new CirclePiece
{
Position = new Vector2(100, 300),
AccentColour = Color4.DarkBlue,
KiaiMode = kiai,
Children = new[]
{
new RimHitSymbolPiece()
}
2017-03-20 06:07:42 +00:00
});
Add(new CirclePiece(true)
2017-03-20 06:07:42 +00:00
{
Position = new Vector2(350, 300),
AccentColour = Color4.DarkBlue,
KiaiMode = kiai,
Children = new[]
{
new RimHitSymbolPiece()
}
2017-03-17 13:01:06 +00:00
});
Add(new CirclePiece
2017-03-20 06:07:42 +00:00
{
Position = new Vector2(100, 500),
AccentColour = Color4.Orange,
KiaiMode = kiai,
Children = new[]
{
new SwellSymbolPiece()
}
2017-03-17 13:01:06 +00:00
});
Add(new ElongatedCirclePiece
{
Position = new Vector2(575, 100),
AccentColour = Color4.Orange,
KiaiMode = kiai,
Length = 0.10f,
PlayfieldLengthReference = () => DrawSize.X
2017-03-20 06:07:42 +00:00
});
Add(new ElongatedCirclePiece(true)
2017-03-20 06:07:42 +00:00
{
Position = new Vector2(575, 300),
AccentColour = Color4.Orange,
KiaiMode = kiai,
Length = 0.10f,
PlayfieldLengthReference = () => DrawSize.X
2017-03-17 13:01:06 +00:00
});
}
private void updateKiaiState()
{
foreach (var c in Children.OfType<CirclePiece>())
c.KiaiMode = kiai;
}
private abstract class BaseCircle : Container
{
protected readonly CirclePiece Piece;
protected BaseCircle(CirclePiece piece)
{
Piece = piece;
Add(Piece);
}
}
2017-03-17 13:01:06 +00:00
}
}