osu/osu.Game.Rulesets.Catch/Objects/Drawables/DrawablePalpableCatchHitObject.cs

46 lines
1.4 KiB
C#
Raw Normal View History

2020-11-24 10:16:03 +00:00
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Rulesets.Catch.Objects.Drawables
{
public abstract class DrawablePalpableCatchHitObject : DrawableCatchHitObject
{
2020-11-24 23:00:11 +00:00
/// <summary>
/// Whether this hit object should stay on the catcher plate when the object is caught by the catcher.
/// </summary>
public virtual bool StaysOnPlate => true;
2020-11-24 10:16:03 +00:00
protected readonly Container ScaleContainer;
protected DrawablePalpableCatchHitObject(CatchHitObject h)
: base(h)
2020-11-24 10:16:03 +00:00
{
Origin = Anchor.Centre;
Size = new Vector2(CatchHitObject.OBJECT_RADIUS * 2);
AddInternal(ScaleContainer = new Container
{
RelativeSizeAxes = Axes.Both,
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
});
2020-11-24 10:16:03 +00:00
}
[BackgroundDependencyLoader]
private void load()
{
ScaleContainer.Scale = new Vector2(HitObject.Scale);
}
protected override Color4 GetComboColour(IReadOnlyList<Color4> comboColours) =>
comboColours[(HitObject.IndexInBeatmap + 1) % comboColours.Count];
}
}