2017-03-20 18:17:31 +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 osu.Framework.Graphics;
|
2017-08-20 20:18:21 +08:00
|
|
|
|
using osu.Framework.Input.Bindings;
|
2017-04-18 15:05:58 +08:00
|
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
|
|
|
|
using osu.Game.Rulesets.Taiko.Judgements;
|
|
|
|
|
using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces;
|
2017-04-05 09:01:40 +08:00
|
|
|
|
using OpenTK;
|
2017-03-20 18:17:31 +08:00
|
|
|
|
|
2017-04-18 15:05:58 +08:00
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
2017-03-20 18:17:31 +08:00
|
|
|
|
{
|
2017-08-20 22:47:07 +08:00
|
|
|
|
public abstract class DrawableTaikoHitObject<TaikoHitType>
|
|
|
|
|
: DrawableScrollingHitObject<TaikoHitObject, TaikoJudgement>, IKeyBindingHandler<TaikoAction>
|
|
|
|
|
where TaikoHitType : TaikoHitObject
|
2017-03-20 18:17:31 +08:00
|
|
|
|
{
|
2017-04-05 09:01:40 +08:00
|
|
|
|
public override Vector2 OriginPosition => new Vector2(DrawHeight / 2);
|
|
|
|
|
|
|
|
|
|
protected readonly TaikoPiece MainPiece;
|
|
|
|
|
|
|
|
|
|
public new TaikoHitType HitObject;
|
|
|
|
|
|
|
|
|
|
protected DrawableTaikoHitObject(TaikoHitType hitObject)
|
2017-03-20 18:17:31 +08:00
|
|
|
|
: base(hitObject)
|
|
|
|
|
{
|
2017-04-05 09:01:40 +08:00
|
|
|
|
HitObject = hitObject;
|
|
|
|
|
|
2017-03-20 18:17:31 +08:00
|
|
|
|
Anchor = Anchor.CentreLeft;
|
2017-04-05 09:01:40 +08:00
|
|
|
|
Origin = Anchor.Custom;
|
|
|
|
|
|
2017-08-03 12:24:13 +08:00
|
|
|
|
RelativeSizeAxes = Axes.Both;
|
|
|
|
|
Size = new Vector2(HitObject.IsStrong ? TaikoHitObject.DEFAULT_STRONG_SIZE : TaikoHitObject.DEFAULT_SIZE);
|
2017-03-20 18:17:31 +08:00
|
|
|
|
|
2017-08-03 12:24:13 +08:00
|
|
|
|
Add(MainPiece = CreateMainPiece());
|
2017-04-05 09:01:40 +08:00
|
|
|
|
MainPiece.KiaiMode = HitObject.Kiai;
|
2017-03-20 18:17:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-03-23 18:00:18 +08:00
|
|
|
|
protected override TaikoJudgement CreateJudgement() => new TaikoJudgement();
|
2017-03-20 18:17:31 +08:00
|
|
|
|
|
2017-08-03 18:49:50 +08:00
|
|
|
|
protected virtual TaikoPiece CreateMainPiece() => new CirclePiece();
|
2017-04-04 11:53:06 +08:00
|
|
|
|
|
2017-08-20 20:18:21 +08:00
|
|
|
|
public abstract bool OnPressed(TaikoAction action);
|
2017-03-25 22:43:41 +08:00
|
|
|
|
|
2017-08-20 20:18:21 +08:00
|
|
|
|
public virtual bool OnReleased(TaikoAction action) => false;
|
|
|
|
|
}
|
2017-03-20 18:17:31 +08:00
|
|
|
|
}
|