mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 12:42:54 +08:00
Merge pull request #13272 from peppy/fix-new-inspections
Fix newly found inspections from 2021.1EAP1
This commit is contained in:
commit
bec836b4d6
@ -141,14 +141,21 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
private Room createRoom(Action<Room> initFunc = null)
|
||||
{
|
||||
var room = new Room();
|
||||
|
||||
room.Name.Value = "test room";
|
||||
room.Playlist.Add(new PlaylistItem
|
||||
var room = new Room
|
||||
{
|
||||
Beatmap = { Value = new TestBeatmap(Ruleset.Value).BeatmapInfo },
|
||||
Ruleset = { Value = Ruleset.Value }
|
||||
});
|
||||
Name =
|
||||
{
|
||||
Value = "test room"
|
||||
},
|
||||
Playlist =
|
||||
{
|
||||
new PlaylistItem
|
||||
{
|
||||
Beatmap = { Value = new TestBeatmap(Ruleset.Value).BeatmapInfo },
|
||||
Ruleset = { Value = Ruleset.Value }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
initFunc?.Invoke(room);
|
||||
return room;
|
||||
|
@ -17,11 +17,12 @@ namespace osu.Game.Tournament.Tests.Screens
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
var match = new TournamentMatch();
|
||||
match.Team1.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym.Value == "USA");
|
||||
match.Team2.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym.Value == "JPN");
|
||||
match.Round.Value = Ladder.Rounds.FirstOrDefault(g => g.Name.Value == "Finals");
|
||||
ladder.CurrentMatch.Value = match;
|
||||
ladder.CurrentMatch.Value = new TournamentMatch
|
||||
{
|
||||
Team1 = { Value = Ladder.Teams.FirstOrDefault(t => t.Acronym.Value == "USA") },
|
||||
Team2 = { Value = Ladder.Teams.FirstOrDefault(t => t.Acronym.Value == "JPN") },
|
||||
Round = { Value = Ladder.Rounds.FirstOrDefault(g => g.Name.Value == "Finals") }
|
||||
};
|
||||
|
||||
Add(new TeamIntroScreen
|
||||
{
|
||||
|
@ -39,7 +39,6 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
public event Action<SelectionState> StateChanged;
|
||||
|
||||
private readonly Box selectionBox;
|
||||
private CachedModelDependencyContainer<Room> dependencies;
|
||||
|
||||
[Resolved(canBeNull: true)]
|
||||
private OnlinePlayScreen parentScreen { get; set; }
|
||||
@ -209,9 +208,10 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
|
||||
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
||||
{
|
||||
dependencies = new CachedModelDependencyContainer<Room>(base.CreateChildDependencies(parent));
|
||||
dependencies.Model.Value = Room;
|
||||
return dependencies;
|
||||
return new CachedModelDependencyContainer<Room>(base.CreateChildDependencies(parent))
|
||||
{
|
||||
Model = { Value = Room }
|
||||
};
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
|
@ -54,12 +54,12 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
Logger.Log($"Polling adjusted (listing: {multiplayerRoomManager.TimeBetweenListingPolls.Value}, selection: {multiplayerRoomManager.TimeBetweenSelectionPolls.Value})");
|
||||
}
|
||||
|
||||
protected override Room CreateNewRoom()
|
||||
{
|
||||
var room = new Room { Name = { Value = $"{API.LocalUser}'s awesome room" } };
|
||||
room.Category.Value = RoomCategory.Realtime;
|
||||
return room;
|
||||
}
|
||||
protected override Room CreateNewRoom() =>
|
||||
new Room
|
||||
{
|
||||
Name = { Value = $"{API.LocalUser}'s awesome room" },
|
||||
Category = { Value = RoomCategory.Realtime }
|
||||
};
|
||||
|
||||
protected override string ScreenTitle => "Multiplayer";
|
||||
|
||||
|
@ -96,15 +96,19 @@ namespace osu.Game.Screens.OnlinePlay
|
||||
{
|
||||
itemSelected = true;
|
||||
|
||||
var item = new PlaylistItem();
|
||||
var item = new PlaylistItem
|
||||
{
|
||||
Beatmap =
|
||||
{
|
||||
Value = Beatmap.Value.BeatmapInfo
|
||||
},
|
||||
Ruleset =
|
||||
{
|
||||
Value = Ruleset.Value
|
||||
}
|
||||
};
|
||||
|
||||
item.Beatmap.Value = Beatmap.Value.BeatmapInfo;
|
||||
item.Ruleset.Value = Ruleset.Value;
|
||||
|
||||
item.RequiredMods.Clear();
|
||||
item.RequiredMods.AddRange(Mods.Value.Select(m => m.CreateCopy()));
|
||||
|
||||
item.AllowedMods.Clear();
|
||||
item.AllowedMods.AddRange(FreeMods.Value.Select(m => m.CreateCopy()));
|
||||
|
||||
SelectItem(item);
|
||||
|
@ -31,12 +31,16 @@ namespace osu.Game.Tests.Beatmaps
|
||||
using (var stream = new LineBufferedReader(resStream))
|
||||
{
|
||||
var decoder = Decoder.GetDecoder<Beatmap>(stream);
|
||||
|
||||
((LegacyBeatmapDecoder)decoder).ApplyOffsets = false;
|
||||
|
||||
var working = new TestWorkingBeatmap(decoder.Decode(stream));
|
||||
working.BeatmapInfo.Ruleset = CreateRuleset().RulesetInfo;
|
||||
|
||||
return working;
|
||||
return new TestWorkingBeatmap(decoder.Decode(stream))
|
||||
{
|
||||
BeatmapInfo =
|
||||
{
|
||||
Ruleset = CreateRuleset().RulesetInfo
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user