1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-18 11:12:57 +08:00
osu-lazer/osu.Game/Beatmaps/IBeatmapConverter.cs

41 lines
1.4 KiB
C#
Raw Normal View History

// 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 17:19:50 +08:00
2022-06-17 15:37:17 +08:00
#nullable disable
2018-04-13 17:19:50 +08:00
using System;
using System.Collections.Generic;
using System.Threading;
2018-07-21 10:38:28 +08:00
using osu.Game.Rulesets;
2018-04-13 17:19:50 +08:00
using osu.Game.Rulesets.Objects;
namespace osu.Game.Beatmaps
{
/// <summary>
/// Provides functionality to convert a <see cref="IBeatmap"/> for a <see cref="Ruleset"/>.
/// </summary>
2018-04-13 17:19:50 +08: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;
IBeatmap Beatmap { get; }
/// <summary>
/// Whether <see cref="Beatmap"/> can be converted by this <see cref="IBeatmapConverter"/>.
/// </summary>
bool CanConvert();
2018-04-13 17:19:50 +08:00
/// <summary>
/// Converts <see cref="Beatmap"/>.
2018-04-13 17:19:50 +08:00
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>The converted Beatmap.</returns>
2020-09-17 17:37:48 +08:00
IBeatmap Convert(CancellationToken cancellationToken = default);
2018-04-13 17:19:50 +08:00
}
}