2019-01-24 08:43:03 +00:00
|
|
|
|
// 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.
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2022-06-17 07:37:17 +00:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2018-03-02 11:19:47 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2020-09-17 08:40:05 +00:00
|
|
|
|
using System.Threading;
|
2018-07-21 02:38:28 +00:00
|
|
|
|
using osu.Game.Rulesets;
|
2018-03-02 11:19:47 +00:00
|
|
|
|
using osu.Game.Rulesets.Objects;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2018-03-02 11:19:47 +00:00
|
|
|
|
namespace osu.Game.Beatmaps
|
|
|
|
|
{
|
2018-06-29 04:07:00 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Provides functionality to convert a <see cref="IBeatmap"/> for a <see cref="Ruleset"/>.
|
|
|
|
|
/// </summary>
|
2018-03-02 11:19:47 +00:00
|
|
|
|
public interface IBeatmapConverter
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Invoked when a <see cref="HitObject"/> has been converted.
|
|
|
|
|
/// The first argument contains the <see cref="HitObject"/> that was converted.
|
|
|
|
|
/// The second argument contains the <see cref="HitObject"/>s that were output from the conversion process.
|
|
|
|
|
/// </summary>
|
|
|
|
|
event Action<HitObject, IEnumerable<HitObject>> ObjectConverted;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2018-04-19 13:04:12 +00:00
|
|
|
|
IBeatmap Beatmap { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Whether <see cref="Beatmap"/> can be converted by this <see cref="IBeatmapConverter"/>.
|
|
|
|
|
/// </summary>
|
2019-12-23 08:44:18 +00:00
|
|
|
|
bool CanConvert();
|
2018-04-19 13:04:12 +00:00
|
|
|
|
|
2018-03-02 11:19:47 +00:00
|
|
|
|
/// <summary>
|
2018-04-19 13:04:12 +00:00
|
|
|
|
/// Converts <see cref="Beatmap"/>.
|
2018-03-02 11:19:47 +00:00
|
|
|
|
/// </summary>
|
2020-09-17 08:40:05 +00:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>The converted Beatmap.</returns>
|
2020-09-17 09:37:48 +00:00
|
|
|
|
IBeatmap Convert(CancellationToken cancellationToken = default);
|
2018-03-02 11:19:47 +00:00
|
|
|
|
}
|
|
|
|
|
}
|