mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 13:23:05 +08:00
Move Palpable* to separate files
This commit is contained in:
parent
916a313f19
commit
4f7aa7e541
@ -105,14 +105,6 @@ namespace osu.Game.Rulesets.Catch.Objects
|
|||||||
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Represents a single object that can be caught by the catcher.
|
|
||||||
/// </summary>
|
|
||||||
public abstract class PalpableCatchHitObject : CatchHitObject
|
|
||||||
{
|
|
||||||
public override bool CanBePlated => true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum FruitVisualRepresentation
|
public enum FruitVisualRepresentation
|
||||||
{
|
{
|
||||||
Pear,
|
Pear,
|
||||||
|
@ -2,49 +2,12 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
|
||||||
using osu.Game.Rulesets.Catch.UI;
|
using osu.Game.Rulesets.Catch.UI;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osuTK;
|
|
||||||
using osuTK.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
||||||
{
|
{
|
||||||
public abstract class DrawablePalpableCatchHitObject : DrawableCatchHitObject
|
|
||||||
{
|
|
||||||
protected Container ScaleContainer { get; private set; }
|
|
||||||
|
|
||||||
protected DrawablePalpableCatchHitObject(CatchHitObject hitObject)
|
|
||||||
: base(hitObject)
|
|
||||||
{
|
|
||||||
Origin = Anchor.Centre;
|
|
||||||
Size = new Vector2(CatchHitObject.OBJECT_RADIUS * 2);
|
|
||||||
Masking = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load()
|
|
||||||
{
|
|
||||||
AddRangeInternal(new Drawable[]
|
|
||||||
{
|
|
||||||
ScaleContainer = new Container
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
ScaleContainer.Scale = new Vector2(HitObject.Scale);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override Color4 GetComboColour(IReadOnlyList<Color4> comboColours) =>
|
|
||||||
comboColours[(HitObject.IndexInBeatmap + 1) % comboColours.Count];
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract class DrawableCatchHitObject : DrawableHitObject<CatchHitObject>
|
public abstract class DrawableCatchHitObject : DrawableHitObject<CatchHitObject>
|
||||||
{
|
{
|
||||||
protected override double InitialLifetimeOffset => HitObject.TimePreempt;
|
protected override double InitialLifetimeOffset => HitObject.TimePreempt;
|
||||||
|
@ -0,0 +1,44 @@
|
|||||||
|
// 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
|
||||||
|
{
|
||||||
|
protected Container ScaleContainer { get; private set; }
|
||||||
|
|
||||||
|
protected DrawablePalpableCatchHitObject(CatchHitObject hitObject)
|
||||||
|
: base(hitObject)
|
||||||
|
{
|
||||||
|
Origin = Anchor.Centre;
|
||||||
|
Size = new Vector2(CatchHitObject.OBJECT_RADIUS * 2);
|
||||||
|
Masking = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
|
AddRangeInternal(new Drawable[]
|
||||||
|
{
|
||||||
|
ScaleContainer = new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
ScaleContainer.Scale = new Vector2(HitObject.Scale);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Color4 GetComboColour(IReadOnlyList<Color4> comboColours) =>
|
||||||
|
comboColours[(HitObject.IndexInBeatmap + 1) % comboColours.Count];
|
||||||
|
}
|
||||||
|
}
|
13
osu.Game.Rulesets.Catch/Objects/PalpableCatchHitObject.cs
Normal file
13
osu.Game.Rulesets.Catch/Objects/PalpableCatchHitObject.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Catch.Objects
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a single object that can be caught by the catcher.
|
||||||
|
/// </summary>
|
||||||
|
public abstract class PalpableCatchHitObject : CatchHitObject
|
||||||
|
{
|
||||||
|
public override bool CanBePlated => true;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user