コード例 #1
0
        public void SetUpSteps()
        {
            AddStep("reset state", () =>
            {
                multiplayerClient.Invocations.Clear();

                beatmapAvailability.Value = BeatmapAvailability.LocallyAvailable();

                var playlistItem = new PlaylistItem(Beatmap.Value.BeatmapInfo)
                {
                    RulesetID = Beatmap.Value.BeatmapInfo.Ruleset.OnlineID
                };

                room.Value = new Room
                {
                    Playlist            = { playlistItem },
                    CurrentPlaylistItem = { Value = playlistItem }
                };

                localUser = new MultiplayerRoomUser(API.LocalUser.Value.Id)
                {
                    User = API.LocalUser.Value
                };

                multiplayerRoom = new MultiplayerRoom(0)
                {
                    Playlist =
                    {
                        new MultiplayerPlaylistItem(playlistItem),
                    },
                    Users = { localUser },
                    Host  = localUser,
                };
            });

            AddStep("create control", () =>
            {
                content.Child = control = new MatchStartControl
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                    Size   = new Vector2(250, 50),
                };
            });
        }
コード例 #2
0
        public new void Setup() => Schedule(() =>
        {
            AvailabilityTracker.SelectedItem.BindTo(selectedItem);

            beatmaps.Import(TestResources.GetQuickTestBeatmapForImport()).WaitSafely();
            importedSet   = beatmaps.GetAllUsableBeatmapSets().First();
            Beatmap.Value = beatmaps.GetWorkingBeatmap(importedSet.Beatmaps.First());

            selectedItem.Value = new PlaylistItem(Beatmap.Value.BeatmapInfo)
            {
                RulesetID = Beatmap.Value.BeatmapInfo.Ruleset.OnlineID
            };

            Child = new PopoverContainer
            {
                RelativeSizeAxes = Axes.Both,
                Child            = control = new MatchStartControl
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                    Size   = new Vector2(250, 50),
                }
            };
        });