private void runSpmTest(Mod mod) { SpinnerSpmCounter spmCounter = null; CreateModTest(new ModTestData { Autoplay = true, Mod = mod, Beatmap = new Beatmap { HitObjects = { new Spinner { Duration = 2000, Position = OsuPlayfield.BASE_SIZE / 2 } } }, PassCondition = () => Player.ScoreProcessor.JudgedHits >= 1 }); AddUntilStep("fetch SPM counter", () => { spmCounter = this.ChildrenOfType <SpinnerSpmCounter>().SingleOrDefault(); return(spmCounter != null); }); AddUntilStep("SPM is correct", () => Precision.AlmostEquals(spmCounter.SpinsPerMinute, 477, 5)); }
private void load(OsuColour colours) { Origin = Anchor.Centre; RelativeSizeAxes = Axes.Both; InternalChildren = new Drawable[] { ticks = new Container <DrawableSpinnerTick>(), new AspectContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Y, Children = new Drawable[] { new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SpinnerBody), _ => new DefaultSpinnerDisc()), RotationTracker = new SpinnerRotationTracker(this) } }, SpmCounter = new SpinnerSpmCounter { Anchor = Anchor.Centre, Origin = Anchor.Centre, Y = 120, Alpha = 0 }, bonusDisplay = new SpinnerBonusDisplay { Anchor = Anchor.Centre, Origin = Anchor.Centre, Y = -120, }, spinningSample = new PausableSkinnableSound { Volume = { Value = 0 }, Looping = true, Frequency = { Value = spinning_sample_initial_frequency } } }; PositionBindable.BindValueChanged(pos => Position = pos.NewValue); }
public DrawableSpinner(Spinner s) : base(s) { Origin = Anchor.Centre; Position = s.Position; RelativeSizeAxes = Axes.Both; Spinner = s; InternalChildren = new Drawable[] { ticks = new Container <DrawableSpinnerTick>(), new AspectContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Y, Children = new Drawable[] { new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SpinnerBody), _ => new DefaultSpinnerDisc()), RotationTracker = new SpinnerRotationTracker(Spinner) } }, SpmCounter = new SpinnerSpmCounter { Anchor = Anchor.Centre, Origin = Anchor.Centre, Y = 120, Alpha = 0 }, bonusDisplay = new SpinnerBonusDisplay { Anchor = Anchor.Centre, Origin = Anchor.Centre, Y = -120, } }; }