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