mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 19:33:20 +08:00
Fix conversion types for Catch and Mania.
This commit is contained in:
parent
09208adf81
commit
04973ae65e
@ -5,13 +5,13 @@ using osu.Game.Beatmaps;
|
|||||||
using osu.Game.Modes.Catch.Objects;
|
using osu.Game.Modes.Catch.Objects;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System;
|
using System;
|
||||||
using osu.Game.Modes.Objects;
|
using osu.Game.Modes.Objects.Types;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Catch.Beatmaps
|
namespace osu.Game.Modes.Catch.Beatmaps
|
||||||
{
|
{
|
||||||
internal class CatchBeatmapConverter : IBeatmapConverter<CatchBaseHit>
|
internal class CatchBeatmapConverter : IBeatmapConverter<CatchBaseHit>
|
||||||
{
|
{
|
||||||
public IEnumerable<Type> ValidConversionTypes { get; } = new[] { typeof(HitObject) };
|
public IEnumerable<Type> ValidConversionTypes { get; } = new[] { typeof(IHasXPosition) };
|
||||||
|
|
||||||
public Beatmap<CatchBaseHit> Convert(Beatmap original)
|
public Beatmap<CatchBaseHit> Convert(Beatmap original)
|
||||||
{
|
{
|
||||||
|
@ -5,13 +5,13 @@ using osu.Game.Beatmaps;
|
|||||||
using osu.Game.Modes.Mania.Objects;
|
using osu.Game.Modes.Mania.Objects;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System;
|
using System;
|
||||||
using osu.Game.Modes.Objects;
|
using osu.Game.Modes.Objects.Types;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Mania.Beatmaps
|
namespace osu.Game.Modes.Mania.Beatmaps
|
||||||
{
|
{
|
||||||
internal class ManiaBeatmapConverter : IBeatmapConverter<ManiaBaseHit>
|
internal class ManiaBeatmapConverter : IBeatmapConverter<ManiaBaseHit>
|
||||||
{
|
{
|
||||||
public IEnumerable<Type> ValidConversionTypes { get; } = new[] { typeof(HitObject) };
|
public IEnumerable<Type> ValidConversionTypes { get; } = new[] { typeof(IHasColumn) };
|
||||||
|
|
||||||
public Beatmap<ManiaBaseHit> Convert(Beatmap original)
|
public Beatmap<ManiaBaseHit> Convert(Beatmap original)
|
||||||
{
|
{
|
||||||
|
@ -15,9 +15,8 @@ namespace osu.Game.Beatmaps
|
|||||||
public interface IBeatmapConverter<T> where T : HitObject
|
public interface IBeatmapConverter<T> where T : HitObject
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The type of HitObjects that can be converted to be used for this Beatmap.
|
/// The types of HitObjects that can be converted to be used for this Beatmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
|
||||||
IEnumerable<Type> ValidConversionTypes { get; }
|
IEnumerable<Type> ValidConversionTypes { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -35,7 +34,7 @@ namespace osu.Game.Beatmaps
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="converter">The Converter to use.</param>
|
/// <param name="converter">The Converter to use.</param>
|
||||||
/// <param name="beatmap">The Beatmap to check.</param>
|
/// <param name="beatmap">The Beatmap to check.</param>
|
||||||
/// <returns>Whether the Beatmap can be converted using <paramref name="converter" />.</returns>
|
/// <returns>Whether the Beatmap can be converted using <paramref name="converter"/>.</returns>
|
||||||
public static bool CanConvert<TObject>(this IBeatmapConverter<TObject> converter, Beatmap beatmap) where TObject : HitObject
|
public static bool CanConvert<TObject>(this IBeatmapConverter<TObject> converter, Beatmap beatmap) where TObject : HitObject
|
||||||
=> converter.ValidConversionTypes.All(t => beatmap.HitObjects.Any(h => t.IsAssignableFrom(h.GetType())));
|
=> converter.ValidConversionTypes.All(t => beatmap.HitObjects.Any(h => t.IsAssignableFrom(h.GetType())));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user