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