1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 16:32:54 +08:00

Rename Mods -> RequiredMods

This commit is contained in:
smoogipoo 2021-02-05 12:36:25 +09:00
parent cf5233c6ab
commit 85e63afcb4
2 changed files with 5 additions and 5 deletions

View File

@ -30,7 +30,7 @@ namespace osu.Game.Online.Multiplayer
[NotNull] [NotNull]
[Key(4)] [Key(4)]
public IEnumerable<APIMod> Mods { get; set; } = Enumerable.Empty<APIMod>(); public IEnumerable<APIMod> RequiredMods { get; set; } = Enumerable.Empty<APIMod>();
[NotNull] [NotNull]
[Key(5)] [Key(5)]
@ -39,14 +39,14 @@ namespace osu.Game.Online.Multiplayer
public bool Equals(MultiplayerRoomSettings other) public bool Equals(MultiplayerRoomSettings other)
=> BeatmapID == other.BeatmapID => BeatmapID == other.BeatmapID
&& BeatmapChecksum == other.BeatmapChecksum && BeatmapChecksum == other.BeatmapChecksum
&& Mods.SequenceEqual(other.Mods) && RequiredMods.SequenceEqual(other.RequiredMods)
&& AllowedMods.SequenceEqual(other.AllowedMods) && AllowedMods.SequenceEqual(other.AllowedMods)
&& RulesetID == other.RulesetID && RulesetID == other.RulesetID
&& Name.Equals(other.Name, StringComparison.Ordinal); && Name.Equals(other.Name, StringComparison.Ordinal);
public override string ToString() => $"Name:{Name}" public override string ToString() => $"Name:{Name}"
+ $" Beatmap:{BeatmapID} ({BeatmapChecksum})" + $" Beatmap:{BeatmapID} ({BeatmapChecksum})"
+ $" Mods:{string.Join(',', Mods)}" + $" RequiredMods:{string.Join(',', RequiredMods)}"
+ $" AllowedMods:{string.Join(',', AllowedMods)}" + $" AllowedMods:{string.Join(',', AllowedMods)}"
+ $" Ruleset:{RulesetID}"; + $" Ruleset:{RulesetID}";
} }

View File

@ -192,7 +192,7 @@ namespace osu.Game.Online.Multiplayer
BeatmapID = item.GetOr(existingPlaylistItem).BeatmapID, BeatmapID = item.GetOr(existingPlaylistItem).BeatmapID,
BeatmapChecksum = item.GetOr(existingPlaylistItem).Beatmap.Value.MD5Hash, BeatmapChecksum = item.GetOr(existingPlaylistItem).Beatmap.Value.MD5Hash,
RulesetID = item.GetOr(existingPlaylistItem).RulesetID, RulesetID = item.GetOr(existingPlaylistItem).RulesetID,
Mods = item.HasValue ? item.Value.AsNonNull().RequiredMods.Select(m => new APIMod(m)).ToList() : Room.Settings.Mods, RequiredMods = item.HasValue ? item.Value.AsNonNull().RequiredMods.Select(m => new APIMod(m)).ToList() : Room.Settings.RequiredMods,
AllowedMods = item.HasValue ? item.Value.AsNonNull().AllowedMods.Select(m => new APIMod(m)).ToList() : Room.Settings.AllowedMods AllowedMods = item.HasValue ? item.Value.AsNonNull().AllowedMods.Select(m => new APIMod(m)).ToList() : Room.Settings.AllowedMods
}); });
} }
@ -531,7 +531,7 @@ namespace osu.Game.Online.Multiplayer
beatmap.MD5Hash = settings.BeatmapChecksum; beatmap.MD5Hash = settings.BeatmapChecksum;
var ruleset = rulesets.GetRuleset(settings.RulesetID).CreateInstance(); var ruleset = rulesets.GetRuleset(settings.RulesetID).CreateInstance();
var mods = settings.Mods.Select(m => m.ToMod(ruleset)); var mods = settings.RequiredMods.Select(m => m.ToMod(ruleset));
var allowedMods = settings.AllowedMods.Select(m => m.ToMod(ruleset)); var allowedMods = settings.AllowedMods.Select(m => m.ToMod(ruleset));
PlaylistItem playlistItem = new PlaylistItem PlaylistItem playlistItem = new PlaylistItem