mirror of
https://github.com/ppy/osu.git
synced 2024-11-12 09:27:51 +08:00
27132958c8
Conflicts: osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj
72 lines
2.5 KiB
C#
72 lines
2.5 KiB
C#
// 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.Game.Beatmaps;
|
|
using osu.Framework.Graphics;
|
|
using osu.Game.Modes.Objects.Drawables;
|
|
using osu.Game.Modes.Replays;
|
|
using osu.Game.Modes.Scoring;
|
|
using osu.Game.Modes.Taiko.Beatmaps;
|
|
using osu.Game.Modes.Taiko.Judgements;
|
|
using osu.Game.Modes.Taiko.Objects;
|
|
using osu.Game.Modes.Taiko.Objects.Drawable;
|
|
using osu.Game.Modes.Taiko.Replays;
|
|
using osu.Game.Modes.Taiko.Scoring;
|
|
using osu.Game.Modes.UI;
|
|
|
|
namespace osu.Game.Modes.Taiko.UI
|
|
{
|
|
public class TaikoHitRenderer : HitRenderer<TaikoHitObject, TaikoJudgement>
|
|
{
|
|
public TaikoHitRenderer(WorkingBeatmap beatmap)
|
|
: base(beatmap)
|
|
{
|
|
}
|
|
|
|
public override ScoreProcessor CreateScoreProcessor() => new TaikoScoreProcessor(this);
|
|
|
|
protected override IBeatmapConverter<TaikoHitObject> CreateBeatmapConverter() => new TaikoBeatmapConverter();
|
|
|
|
protected override IBeatmapProcessor<TaikoHitObject> CreateBeatmapProcessor() => new TaikoBeatmapProcessor();
|
|
|
|
protected override Playfield<TaikoHitObject, TaikoJudgement> CreatePlayfield() => new TaikoPlayfield
|
|
{
|
|
Anchor = Anchor.CentreLeft,
|
|
Origin = Anchor.CentreLeft
|
|
};
|
|
|
|
protected override DrawableHitObject<TaikoHitObject, TaikoJudgement> GetVisualRepresentation(TaikoHitObject h)
|
|
{
|
|
var hit = h as Hit;
|
|
if (hit != null)
|
|
{
|
|
switch (hit.Type)
|
|
{
|
|
case HitType.Centre:
|
|
if (h.IsStrong)
|
|
return new DrawableStrongCentreHit(hit);
|
|
return new DrawableCentreHit(hit);
|
|
case HitType.Rim:
|
|
if (h.IsStrong)
|
|
return new DrawableStrongRimHit(hit);
|
|
return new DrawableRimHit(hit);
|
|
}
|
|
}
|
|
|
|
var drumRoll = h as DrumRoll;
|
|
if (drumRoll != null)
|
|
{
|
|
if (h.IsStrong)
|
|
return new DrawableStrongDrumRoll(drumRoll);
|
|
return new DrawableDrumRoll(drumRoll);
|
|
}
|
|
|
|
var swell = h as Swell;
|
|
if (swell != null)
|
|
return new DrawableSwell(swell);
|
|
|
|
return null;
|
|
}
|
|
}
|
|
}
|