1
0
mirror of https://github.com/ppy/osu.git synced 2024-05-15 04:10:24 +08:00
osu-lazer/Templates/Rulesets/ruleset-empty/osu.Game.Rulesets.EmptyFreeform/Objects/Drawables/DrawableEmptyFreeformHitObject.cs
2024-02-05 13:37:38 +01:00

50 lines
1.5 KiB
C#

// 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 osu.Framework.Graphics;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Scoring;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Rulesets.EmptyFreeform.Objects.Drawables
{
public partial class DrawableEmptyFreeformHitObject : DrawableHitObject<EmptyFreeformHitObject>
{
public DrawableEmptyFreeformHitObject(EmptyFreeformHitObject hitObject)
: base(hitObject)
{
Size = new Vector2(40);
Origin = Anchor.Centre;
Position = hitObject.Position;
// todo: add visuals.
}
protected override void CheckForResult(bool userTriggered, double timeOffset)
{
if (timeOffset >= 0)
// todo: implement judgement logic
ApplyResult(HitResult.Perfect);
}
protected override void UpdateHitStateTransforms(ArmedState state)
{
const double duration = 1000;
switch (state)
{
case ArmedState.Hit:
this.FadeOut(duration, Easing.OutQuint).Expire();
break;
case ArmedState.Miss:
this.FadeColour(Color4.Red, duration);
this.FadeOut(duration, Easing.InQuint).Expire();
break;
}
}
}
}