Remove ctor params from DrawableRoomPlaylist/DrawablePlaylistItem

This commit is contained in:
Dan Balasescu
2021-12-09 01:04:28 +09:00
parent beb5d61a42
commit 3be4d8b68d
10 changed files with 105 additions and 60 deletions

View File

@ -329,10 +329,26 @@ namespace osu.Game.Tests.Visual.Multiplayer
{
public new IReadOnlyDictionary<PlaylistItem, RearrangeableListItem<PlaylistItem>> ItemMap => base.ItemMap;
private readonly bool allowEdit;
private readonly bool allowSelection;
private readonly bool showItemOwner;
public TestPlaylist(bool allowEdit, bool allowSelection, bool showItemOwner = false)
: base(allowEdit, allowSelection, showItemOwner)
{
this.allowEdit = allowEdit;
this.allowSelection = allowSelection;
this.showItemOwner = showItemOwner;
}
protected override OsuRearrangeableListItem<PlaylistItem> CreateOsuDrawable(PlaylistItem item) => base.CreateOsuDrawable(item).With(d =>
{
var drawablePlaylistItem = (DrawableRoomPlaylistItem)d;
drawablePlaylistItem.AllowReordering = allowEdit;
drawablePlaylistItem.AllowDeletion = allowEdit;
drawablePlaylistItem.AllowSelection = allowSelection;
drawablePlaylistItem.ShowItemOwner = showItemOwner;
});
}
}
}