public void SetUp() => Schedule(() =>
        {
            beatmaps.AllowImport = new TaskCompletionSource <bool>();

            testBeatmapFile = TestResources.GetQuickTestBeatmapForImport();

            testBeatmapInfo = getTestBeatmapInfo(testBeatmapFile);
            testBeatmapSet  = testBeatmapInfo.BeatmapSet;

            var existing = beatmaps.QueryBeatmapSet(s => s.OnlineBeatmapSetID == testBeatmapSet.OnlineBeatmapSetID);
            if (existing != null)
            {
                beatmaps.Delete(existing);
            }

            selectedItem.Value = new PlaylistItem
            {
                Beatmap = { Value = testBeatmapInfo },
                Ruleset = { Value = testBeatmapInfo.Ruleset },
            };

            Child = availablilityTracker = new OnlinePlayBeatmapAvailablilityTracker
            {
                SelectedItem = { BindTarget = selectedItem, }
            };
        });
Esempio n. 2
0
 protected RoomSubScreen()
 {
     AddInternal(BeatmapAvailablilityTracker = new OnlinePlayBeatmapAvailablilityTracker
     {
         SelectedItem = { BindTarget = SelectedItem }
     });
 }
Esempio n. 3
0
        private void load(OnlinePlayBeatmapAvailablilityTracker beatmapTracker)
        {
            availability = beatmapTracker.Availability.GetBoundCopy();

            availability.BindValueChanged(_ => updateState());
            Enabled.BindValueChanged(_ => updateState(), true);
        }
Esempio n. 4
0
 protected RoomSubScreen()
 {
     AddRangeInternal(new Drawable[]
     {
         BeatmapAvailablilityTracker = new OnlinePlayBeatmapAvailablilityTracker
         {
             SelectedItem = { BindTarget = SelectedItem }
         },
         new Container
         {
             Anchor           = Anchor.BottomLeft,
             Origin           = Anchor.BottomLeft,
             Depth            = float.MinValue,
             RelativeSizeAxes = Axes.Both,
             Height           = 0.5f,
             Padding          = new MarginPadding {
                 Horizontal = HORIZONTAL_OVERFLOW_PADDING
             },
             Child = userModsSelectOverlay = new UserModSelectOverlay
             {
                 SelectedMods = { BindTarget = UserMods },
                 IsValidMod   = _ => false
             }
         },
     });
 }
Esempio n. 5
0
        private void load(GameHost host, AudioManager audio)
        {
            Dependencies.Cache(rulesets = new RulesetStore(ContextFactory));
            Dependencies.Cache(beatmaps = new BeatmapManager(LocalStorage, ContextFactory, rulesets, null, audio, host, Beatmap.Default));
            beatmaps.Import(TestResources.GetTestBeatmapForImport(true)).Wait();

            Add(beatmapTracker = new OnlinePlayBeatmapAvailablilityTracker
            {
                SelectedItem = { BindTarget = selectedItem }
            });

            Dependencies.Cache(beatmapTracker);
        }
        public void TestTrackerRespectsChecksum()
        {
            AddStep("allow importing", () => beatmaps.AllowImport.SetResult(true));

            AddStep("import altered beatmap", () =>
            {
                beatmaps.Import(TestResources.GetTestBeatmapForImport(true)).Wait();
            });
            addAvailabilityCheckStep("state still not downloaded", BeatmapAvailability.NotDownloaded);

            AddStep("recreate tracker", () => Child = availablilityTracker = new OnlinePlayBeatmapAvailablilityTracker
            {
                SelectedItem = { BindTarget = selectedItem }
            });
            addAvailabilityCheckStep("state not downloaded as well", BeatmapAvailability.NotDownloaded);
        }