// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Catch.Objects.Drawables; namespace osu.Game.Rulesets.Catch.Skinning.Default { internal class FruitPiece : CatchHitObjectPiece { /// /// Because we're adding a border around the fruit, we need to scale down some. /// public const float RADIUS_ADJUST = 1.1f; public readonly Bindable VisualRepresentation = new Bindable(); protected override BorderPiece BorderPiece { get; } protected override HyperBorderPiece HyperBorderPiece { get; } public FruitPiece() { RelativeSizeAxes = Axes.Both; InternalChildren = new Drawable[] { new FruitPulpFormation { AccentColour = { BindTarget = AccentColour }, VisualRepresentation = { BindTarget = VisualRepresentation } }, BorderPiece = new BorderPiece(), HyperBorderPiece = new HyperBorderPiece() }; } protected override void LoadComplete() { base.LoadComplete(); var fruitState = (IHasFruitState)ObjectState; VisualRepresentation.BindTo(fruitState.VisualRepresentation); } } }