mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
Rename multiplayer mod usages to make more sense
This commit is contained in:
parent
820a672940
commit
add9f3ec91
@ -39,8 +39,8 @@ namespace osu.Game.Rulesets.Mods
|
||||
/// <remarks>
|
||||
/// <list type="bullet">
|
||||
/// <item>Should be always <c>false</c> for cases where the user is not interacting with the game.</item>
|
||||
/// <item>Should be <c>false</c> in <see cref="ModUsage.MultiplayerRequired"/> 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.MultiplayerFree"/> for mods that affect the gameplay duration (e.g. <see cref="ModRateAdjust"/> and <see cref="ModTimeRamp"/>).</item>
|
||||
/// <item>Should be <c>false</c> in <see cref="ModUsage.MultiplayerRoomWide"/> 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.MultiplayerPerPlayer"/> for mods that affect the gameplay duration (e.g. <see cref="ModRateAdjust"/> and <see cref="ModTimeRamp"/>).</item>
|
||||
/// </list>
|
||||
/// </remarks>
|
||||
/// <param name="usage">The mod usage.</param>
|
||||
|
@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
public abstract class ModRateAdjust : Mod, IApplicableToRate
|
||||
{
|
||||
public override bool IsPlayable(ModUsage usage) => usage != ModUsage.MultiplayerFree;
|
||||
public override bool IsPlayable(ModUsage usage) => usage != ModUsage.MultiplayerPerPlayer;
|
||||
|
||||
public abstract BindableNumber<double> SpeedChange { get; }
|
||||
|
||||
|
@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
[SettingSource("Adjust pitch", "Should pitch be adjusted with speed")]
|
||||
public abstract BindableBool AdjustPitch { get; }
|
||||
|
||||
public override bool IsPlayable(ModUsage usage) => usage != ModUsage.MultiplayerFree;
|
||||
public override bool IsPlayable(ModUsage usage) => usage != ModUsage.MultiplayerPerPlayer;
|
||||
|
||||
public override Type[] IncompatibleMods => new[] { typeof(ModRateAdjust), typeof(ModAdaptiveSpeed) };
|
||||
|
||||
|
@ -9,18 +9,20 @@ namespace osu.Game.Rulesets.Mods
|
||||
public enum ModUsage
|
||||
{
|
||||
/// <summary>
|
||||
/// Used for a per-user gameplay session. Determines whether the mod is playable by an end user.
|
||||
/// Used for a per-user gameplay session.
|
||||
/// Determines whether the mod is playable by an end user.
|
||||
/// </summary>
|
||||
User,
|
||||
|
||||
/// <summary>
|
||||
/// Used as a "required mod" for a multiplayer match.
|
||||
/// Used in multiplayer but must be applied to all users.
|
||||
/// This is generally the case for mods which affect the length of gameplay.
|
||||
/// </summary>
|
||||
MultiplayerRequired,
|
||||
MultiplayerRoomWide,
|
||||
|
||||
/// <summary>
|
||||
/// Used as a "free mod" for a multiplayer match.
|
||||
/// Used in multiplayer either at a room or per-player level (i.e. "free mod").
|
||||
/// </summary>
|
||||
MultiplayerFree,
|
||||
MultiplayerPerPlayer,
|
||||
}
|
||||
}
|
||||
|
@ -117,8 +117,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
|
||||
protected override BeatmapDetailArea CreateBeatmapDetailArea() => new PlayBeatmapDetailArea();
|
||||
|
||||
protected override bool IsValidMod(Mod mod) => base.IsValidMod(mod) && mod.IsPlayable(ModUsage.MultiplayerRequired);
|
||||
protected override bool IsValidMod(Mod mod) => base.IsValidMod(mod) && mod.IsPlayable(ModUsage.MultiplayerRoomWide);
|
||||
|
||||
protected override bool IsValidFreeMod(Mod mod) => base.IsValidFreeMod(mod) && mod.IsPlayable(ModUsage.MultiplayerFree);
|
||||
protected override bool IsValidFreeMod(Mod mod) => base.IsValidFreeMod(mod) && mod.IsPlayable(ModUsage.MultiplayerPerPlayer);
|
||||
}
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ namespace osu.Game.Utils
|
||||
/// <param name="invalidMods">Invalid mods, if any were found. Will be null if all mods were valid.</param>
|
||||
/// <returns>Whether the input mods were all valid. If false, <paramref name="invalidMods"/> will contain all invalid entries.</returns>
|
||||
public static bool CheckValidRequiredModsForMultiplayer(IEnumerable<Mod> mods, [NotNullWhen(false)] out List<Mod>? invalidMods)
|
||||
=> checkValid(mods, m => m.IsPlayable(ModUsage.MultiplayerRequired), out invalidMods);
|
||||
=> checkValid(mods, m => m.IsPlayable(ModUsage.MultiplayerRoomWide), out invalidMods);
|
||||
|
||||
/// <summary>
|
||||
/// Check the provided combination of mods are valid as "free mods" in a multiplayer match session.
|
||||
@ -130,7 +130,7 @@ namespace osu.Game.Utils
|
||||
/// <param name="invalidMods">Invalid mods, if any were found. Will be null if all mods were valid.</param>
|
||||
/// <returns>Whether the input mods were all valid. If false, <paramref name="invalidMods"/> will contain all invalid entries.</returns>
|
||||
public static bool CheckValidFreeModsForMultiplayer(IEnumerable<Mod> mods, [NotNullWhen(false)] out List<Mod>? invalidMods)
|
||||
=> checkValid(mods, m => m.IsPlayable(ModUsage.MultiplayerFree), out invalidMods);
|
||||
=> checkValid(mods, m => m.IsPlayable(ModUsage.MultiplayerPerPlayer), out invalidMods);
|
||||
|
||||
private static bool checkValid(IEnumerable<Mod> mods, Predicate<Mod> valid, [NotNullWhen(false)] out List<Mod>? invalidMods)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user