示例#1
0
        private Drawable testSingle(bool auto = false)
        {
            var slider = new Slider
            {
                StartTime = Time.Current + 1000,
                Nodes     = new BindableList <SliderNode>(new[]
                {
                    new SliderNode(0, 0),
                    new SliderNode(500, 90),
                    new SliderNode(1000, 180),
                    new SliderNode(1500, 270),
                    new SliderNode(2000, 0),
                    new SliderNode(2500, 90),
                    new SliderNode(3000, 180),
                    new SliderNode(3500, 270),
                    new SliderNode(4000, 0),
                    new SliderNode(4500, 90),
                    new SliderNode(5000, 180),
                    new SliderNode(5500, 270),
                    new SliderNode(6000, 0),
                    new SliderNode(6500, 90),
                    new SliderNode(7000, 180),
                    new SliderNode(7500, 270),
                })
            };

            slider.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

            return(new TestDrawableSlider(slider, auto)
            {
                Anchor = Anchor.Centre,
                Origin = Anchor.Centre,
                Depth = depthIndex++
            });
        }
示例#2
0
        private void addSlider(Slider slider, float circleSize, double speedMultiplier)
        {
            var cpi = new ControlPointInfo();

            cpi.DifficultyPoints.Add(new DifficultyControlPoint {
                SpeedMultiplier = speedMultiplier
            });

            slider.ApplyDefaults(cpi, new BeatmapDifficulty {
                CircleSize = circleSize, SliderTickRate = 3
            });

            var drawable = new DrawableSlider(slider)
            {
                Anchor = Anchor.Centre,
                Depth  = depthIndex++
            };

            foreach (var mod in Mods.OfType <IApplicableToDrawableHitObjects>())
            {
                mod.ApplyToDrawableHitObjects(new[] { drawable });
            }

            drawable.OnJudgement += onJudgement;

            Add(drawable);
        }
示例#3
0
        public TestCaseSliderSelectionBlueprint()
        {
            var slider = new Slider
            {
                Position = new Vector2(256, 192),
                Path     = new SliderPath(PathType.Bezier, new[]
                {
                    Vector2.Zero,
                    new Vector2(150, 150),
                    new Vector2(300, 0)
                })
            };

            slider.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty {
                CircleSize = 2
            });

            Add(drawableObject = new DrawableSlider(slider));
        }
        private void load()
        {
            var playfield = new OsuEditPlayfield();

            Children = new Drawable[]
            {
                new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Clock            = new FramedClock(new StopwatchClock()),
                    Child            = playfield
                },
                new SelectionLayer(playfield)
            };

            var hitCircle1 = new HitCircle {
                Position = new Vector2(256, 192), Scale = 0.5f
            };
            var hitCircle2 = new HitCircle {
                Position = new Vector2(344, 148), Scale = 0.5f
            };
            var slider = new Slider
            {
                ControlPoints = new List <Vector2>
                {
                    new Vector2(128, 256),
                    new Vector2(344, 256),
                },
                Distance     = 400,
                Position     = new Vector2(128, 256),
                Velocity     = 1,
                TickDistance = 100,
                Scale        = 0.5f,
            };

            hitCircle1.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
            hitCircle2.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
            slider.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

            playfield.Add(new DrawableHitCircle(hitCircle1));
            playfield.Add(new DrawableHitCircle(hitCircle2));
            playfield.Add(new DrawableSlider(slider));
        }
示例#5
0
        public void TestTooShortSlider()
        {
            Slider slider = new Slider
            {
                StartTime   = 0,
                RepeatCount = 0,
                Path        = new SliderPath(new[]
                {
                    new PathControlPoint(new Vector2(0, 0)),
                    new PathControlPoint(new Vector2(10, 0))
                })
            };

            slider.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

            assertTooShort(new List <HitObject> {
                slider
            });
        }
示例#6
0
        public void TestTooShortSliderWithRepeats()
        {
            // Would be ok if we looked at the duration, but not if we look at the span duration.
            Slider slider = new Slider
            {
                StartTime   = 0,
                RepeatCount = 2,
                Path        = new SliderPath(new[]
                {
                    new PathControlPoint(new Vector2(0, 0)),
                    new PathControlPoint(new Vector2(10, 0))
                })
            };

            slider.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

            assertTooShort(new List <HitObject> {
                slider
            });
        }
示例#7
0
        public void Setup() => Schedule(() =>
        {
            Clear();

            slider = new Slider
            {
                Position = new Vector2(256, 192),
                Path     = new SliderPath(PathType.Bezier, new[]
                {
                    Vector2.Zero,
                    new Vector2(150, 150),
                    new Vector2(300, 0)
                })
            };

            slider.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty {
                CircleSize = 2
            });

            Add(drawableObject     = new DrawableSlider(slider));
            AddBlueprint(blueprint = new TestSliderBlueprint(drawableObject));
        });
        private Drawable createDrawable(Slider slider, float circleSize, double speedMultiplier)
        {
            var cpi = new ControlPointInfo();

            cpi.Add(0, new DifficultyControlPoint {
                SpeedMultiplier = speedMultiplier
            });

            slider.ApplyDefaults(cpi, new BeatmapDifficulty {
                CircleSize = circleSize, SliderTickRate = 3
            });

            var drawable = CreateDrawableSlider(slider);

            foreach (var mod in Mods.Value.OfType <IApplicableToDrawableHitObjects>())
            {
                mod.ApplyToDrawableHitObjects(new[] { drawable });
            }

            drawable.OnNewResult += onNewResult;

            return(drawable);
        }
示例#9
0
 private Slider prepareObject(Slider slider)
 {
     slider.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
     return(slider);
 }
 public void Setup() => Schedule(() =>
 {
     slider = new Slider();
     slider.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
 });