2019-01-24 16:43:03 +08: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-11-30 16:50:27 +08:00
2019-05-03 09:05:45 +08:00
using System ;
2021-09-10 10:09:13 +08:00
using osu.Framework.Graphics.Sprites ;
2018-12-12 15:06:56 +08:00
2018-11-30 16:50:27 +08:00
namespace osu.Game.Rulesets.Mods
2018-11-30 16:16:00 +08:00
{
2019-05-03 09:05:45 +08:00
public interface IMod : IEquatable < IMod >
2018-11-30 16:16:00 +08:00
{
/// <summary>
/// The shortened name of this mod.
/// </summary>
string Acronym { get ; }
2021-09-10 10:09:13 +08:00
2021-09-10 11:42:53 +08:00
/// <summary>
/// The name of this mod.
/// </summary>
string Name { get ; }
/// <summary>
/// The user readable description of this mod.
/// </summary>
string Description { get ; }
/// <summary>
/// The type of this mod.
/// </summary>
ModType Type { get ; }
2021-09-10 10:09:13 +08:00
/// <summary>
/// The icon of this mod.
/// </summary>
IconUsage ? Icon { get ; }
/// <summary>
2022-03-18 07:08:11 +08:00
/// Whether this mod is playable for the given usage.
2021-09-10 10:09:13 +08:00
/// </summary>
2022-03-18 07:08:11 +08:00
/// <remarks>
/// <list type="bullet">
/// <item>Should be always <c>false</c> for cases where the user is not interacting with the game.</item>
2022-05-04 22:08:41 +08:00
/// <item>Should be <c>false</c> in <see cref="ModUsage.MultiplayerGlobal"/> for mods that make gameplay duration dependent on user input (e.g. <see cref="ModAdaptiveSpeed"/>).</item>
/// <item>Should be <c>false</c> in <see cref="ModUsage.MultiplayerLocal"/> for mods that affect the gameplay duration (e.g. <see cref="ModRateAdjust"/> and <see cref="ModTimeRamp"/>).</item>
2022-03-18 07:08:11 +08:00
/// </list>
/// </remarks>
/// <param name="usage">The mod usage.</param>
bool IsPlayable ( ModUsage usage ) ;
2021-09-10 10:09:13 +08:00
2022-03-17 08:40:15 +08:00
/// <summary>
2022-03-18 07:08:11 +08:00
/// Whether this mod is playable by an end user.
/// Should be <c>false</c> for cases where the user is not interacting with the game (so it can be excluded from multiplayer selection, for example).
2022-03-17 08:40:15 +08:00
/// </summary>
2022-05-04 22:22:11 +08:00
[Obsolete("Override IsPlayable instead.")] // Can be removed 20221104
2022-03-18 07:08:11 +08:00
bool UserPlayable { get ; }
2022-03-17 08:40:15 +08:00
2021-09-10 10:09:13 +08:00
/// <summary>
/// Create a fresh <see cref="Mod"/> instance based on this mod.
/// </summary>
2021-09-10 11:05:10 +08:00
Mod CreateInstance ( ) = > ( Mod ) Activator . CreateInstance ( GetType ( ) ) ;
2018-11-30 16:16:00 +08:00
}
}