1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-09 04:17:25 +08:00
osu-lazer/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs

165 lines
4.2 KiB
C#
Raw Normal View History

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
using OpenTK;
using osu.Framework.Allocation;
using osu.Framework.Graphics.Containers;
2017-03-17 21:01:06 +08:00
using osu.Framework.Screens.Testing;
using osu.Game.Graphics;
using osu.Game.Modes.Taiko.Objects.Drawable.Pieces;
2017-03-17 21:01:06 +08:00
namespace osu.Desktop.VisualTests.Tests
{
internal class TestCaseTaikoHitObjects : TestCase
{
public override string Description => "Taiko hit objects";
private bool kiai;
2017-03-17 21:01:06 +08:00
public override void Reset()
{
base.Reset();
AddToggle("Kiai", b =>
{
kiai = !kiai;
Reset();
});
Add(new CentreHitCircle(new CirclePiece(@"centre")
{
KiaiMode = kiai
})
2017-03-17 21:01:06 +08:00
{
2017-03-20 14:07:42 +08:00
Position = new Vector2(100, 100)
});
Add(new CentreHitCircle(new AccentedCirclePiece(@"centre")
{
KiaiMode = kiai
})
2017-03-20 14:07:42 +08:00
{
Position = new Vector2(350, 100)
2017-03-17 21:01:06 +08:00
});
Add(new RimHitCircle(new CirclePiece(@"rim")
{
KiaiMode = kiai
})
2017-03-17 21:01:06 +08:00
{
Position = new Vector2(100, 300)
2017-03-20 14:07:42 +08:00
});
Add(new RimHitCircle(new AccentedCirclePiece(@"rim")
{
KiaiMode = kiai
})
2017-03-20 14:07:42 +08:00
{
Position = new Vector2(350, 300)
2017-03-17 21:01:06 +08:00
});
Add(new SwellCircle(new CirclePiece(@"swell")
{
KiaiMode = kiai
})
2017-03-17 21:01:06 +08:00
{
Position = new Vector2(100, 500)
2017-03-20 14:07:42 +08:00
});
Add(new SwellCircle(new AccentedCirclePiece(@"swell")
{
KiaiMode = kiai
})
2017-03-20 14:07:42 +08:00
{
Position = new Vector2(350, 500)
2017-03-17 21:01:06 +08:00
});
Add(new DrumRollCircle(new CirclePiece(string.Empty)
2017-03-17 21:01:06 +08:00
{
2017-03-20 14:07:42 +08:00
Width = 250,
KiaiMode = kiai
})
{
Position = new Vector2(575, 100)
2017-03-20 14:07:42 +08:00
});
Add(new DrumRollCircle(new AccentedCirclePiece(string.Empty)
2017-03-20 14:07:42 +08:00
{
Width = 250,
KiaiMode = kiai
2017-03-20 14:07:42 +08:00
})
{
Position = new Vector2(575, 300)
2017-03-17 21:01:06 +08:00
});
}
private class SwellCircle : BaseCircle
{
public SwellCircle(CirclePiece piece)
: base(piece)
{
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Piece.AccentColour = colours.YellowDark;
}
}
private class DrumRollCircle : BaseCircle
{
public DrumRollCircle(CirclePiece piece)
: base(piece)
{
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Piece.AccentColour = colours.YellowDark;
}
}
private class CentreHitCircle : BaseCircle
{
public CentreHitCircle(CirclePiece piece)
: base(piece)
{
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Piece.AccentColour = colours.PinkDarker;
}
}
private class RimHitCircle : BaseCircle
{
public RimHitCircle(CirclePiece piece)
: base(piece)
{
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Piece.AccentColour = colours.BlueDarker;
}
}
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
}
}