Esempio n. 1
0
        public TestSceneGameplayCursor()
        {
            var ruleset = new OsuRuleset();

            gameplayState = TestGameplayState.Create(ruleset);

            AddStep("change background colour", () =>
            {
                background?.Expire();

                Add(background = new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Depth            = float.MaxValue,
                    Colour           = new Colour4(RNG.NextSingle(), RNG.NextSingle(), RNG.NextSingle(), 1)
                });
            });

            AddSliderStep("circle size", 0f, 10f, 0f, val =>
            {
                config.SetValue(OsuSetting.AutoCursorSize, true);
                gameplayState.Beatmap.Difficulty.CircleSize = val;
                Scheduler.AddOnce(loadContent);
            });

            AddStep("test cursor container", () => loadContent(false));
        }
Esempio n. 2
0
        public void TestFinalFramesPurgedBeforeEndingPlay()
        {
            AddStep("begin playing", () => spectatorClient.BeginPlaying(TestGameplayState.Create(new OsuRuleset()), new Score()));

            AddStep("send frames and finish play", () =>
            {
                spectatorClient.HandleFrame(new OsuReplayFrame(1000, Vector2.Zero));

                var completedGameplayState       = TestGameplayState.Create(new OsuRuleset());
                completedGameplayState.HasPassed = true;
                spectatorClient.EndPlaying(completedGameplayState);
            });

            // We can't access API because we're an "online" test.
            AddAssert("last received frame has time = 1000", () => spectatorClient.LastReceivedUserFrames.First().Value.Time == 1000);
        }