Ejemplo n.º 1
0
        private void load()
        {
            Origin           = Anchor.Centre;
            RelativeSizeAxes = Axes.Both;

            AddRangeInternal(new Drawable[]
            {
                spmCalculator = new SpinnerSpmCalculator
                {
                    Result = { BindTarget = SpinsPerMinute },
                },
                ticks = new Container <DrawableSpinnerTick>(),
                new AspectContainer
                {
                    Anchor           = Anchor.Centre,
                    Origin           = Anchor.Centre,
                    RelativeSizeAxes = Axes.Y,
                    Children         = new Drawable[]
                    {
                        Body            = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SpinnerBody), _ => new DefaultSpinner()),
                        RotationTracker = new SpinnerRotationTracker(this)
                    }
                },
                spinningSample = new PausableSkinnableSound
                {
                    Volume    = { Value = 0 },
                    Looping   = true,
                    Frequency = { Value = spinning_sample_initial_frequency }
                }
            });

            PositionBindable.BindValueChanged(pos => Position = pos.NewValue);
        }
Ejemplo n.º 2
0
        private void runSpmTest(Mod mod)
        {
            SpinnerSpmCalculator spmCalculator = null;

            CreateModTest(new ModTestData
            {
                Autoplay = true,
                Mod      = mod,
                Beatmap  = new Beatmap
                {
                    HitObjects =
                    {
                        new Spinner
                        {
                            Duration = 6000,
                            Position = OsuPlayfield.BASE_SIZE / 2,
                        }
                    }
                },
                PassCondition = () => Player.ScoreProcessor.JudgedHits >= 1
            });

            AddUntilStep("fetch SPM calculator", () =>
            {
                spmCalculator = this.ChildrenOfType <SpinnerSpmCalculator>().SingleOrDefault();
                return(spmCalculator != null);
            });

            AddUntilStep("SPM is correct", () => Precision.AlmostEquals(spmCalculator.Result.Value, 477, 5));
        }