From 1cfe58e9058cbbe6827287ccbaecddb47bd7f479 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Wed, 29 Mar 2017 11:22:27 +0900 Subject: [PATCH] Implement convesion from TaikoHitObjects to DrawableTaikoHitObjects. --- .../Objects/Drawable/DrawableDrumRollTick.cs | 1 - osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs | 34 ++++++++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs index b6a20bab8d..11a4b56930 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs @@ -10,7 +10,6 @@ using osu.Framework.Graphics.Containers; using OpenTK; using OpenTK.Graphics; using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.Transforms; namespace osu.Game.Modes.Taiko.Objects.Drawable { diff --git a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs b/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs index 3266b5c030..aae0dfc0b8 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs @@ -7,6 +7,7 @@ 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.Scoring; using osu.Game.Modes.UI; @@ -27,6 +28,37 @@ namespace osu.Game.Modes.Taiko.UI protected override Playfield CreatePlayfield() => new TaikoPlayfield(); - protected override DrawableHitObject GetVisualRepresentation(TaikoHitObject h) => null; + protected override DrawableHitObject 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; + } } }