From 9d67a3f6a4fc9ede66ba02d3f51b0be7c41b5366 Mon Sep 17 00:00:00 2001 From: David Zhao Date: Thu, 27 Jun 2019 14:42:04 +0900 Subject: [PATCH] clean up ChannelManagerContainer --- .../TestSceneChatOverlayScenarios.cs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneChatOverlayScenarios.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneChatOverlayScenarios.cs index bb7d8df09f..70b7ba3769 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneChatOverlayScenarios.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneChatOverlayScenarios.cs @@ -43,7 +43,6 @@ namespace osu.Game.Tests.Visual.UserInterface Child = container = new ChannelManagerContainer(new List { channel1, channel2 }) { RelativeSizeAxes = Axes.Both, }; chatOverlay = container.ChatOverlay; channelManager = container.ChannelManager; - chatOverlay.Show(); }); } @@ -86,12 +85,10 @@ namespace osu.Game.Tests.Visual.UserInterface private class ChannelManagerContainer : Container { - [Cached] - private ChannelManager channelManager = new ChannelManager(); - public TestChatOverlay ChatOverlay { get; private set; } - public ChannelManager ChannelManager => channelManager; + [Cached] + public ChannelManager ChannelManager { get; } = new ChannelManager(); private readonly List channels; @@ -103,15 +100,10 @@ namespace osu.Game.Tests.Visual.UserInterface [BackgroundDependencyLoader] private void load() { - var availableChannels = (BindableList)channelManager.AvailableChannels; + ((BindableList)ChannelManager.AvailableChannels).AddRange(channels); - availableChannels.AddRange(channels); - - Child = ChatOverlay = new TestChatOverlay - { - RelativeSizeAxes = Axes.Both, - Size = new Vector2(1) - }; + Child = ChatOverlay = new TestChatOverlay { RelativeSizeAxes = Axes.Both, }; + ChatOverlay.Show(); } }