Ejemplo n.º 1
0
 public void Setup() => Schedule(() =>
 {
     Children = new Drawable[]
     {
         new Box
         {
             RelativeSizeAxes = Axes.Both,
             Colour           = Color4.SlateGray
         },
         grid = new TestDistanceSnapGrid()
     };
 });
Ejemplo n.º 2
0
        private void createGrid(Action <TestDistanceSnapGrid> func = null, string description = null)
        {
            AddStep($"create grid {description ?? string.Empty}", () =>
            {
                Children = new Drawable[]
                {
                    new Box
                    {
                        RelativeSizeAxes = Axes.Both,
                        Colour           = Color4.SlateGray
                    },
                    grid = new TestDistanceSnapGrid(new HitObject(), grid_position)
                };

                func?.Invoke(grid);
            });
        }
Ejemplo n.º 3
0
        public void TestLimitedDistance(double multiplier)
        {
            const int end_time = 100;

            AddStep("create limited grid", () =>
            {
                Children = new Drawable[]
                {
                    new Box
                    {
                        RelativeSizeAxes = Axes.Both,
                        Colour           = Color4.SlateGray
                    },
                    grid = new TestDistanceSnapGrid(end_time)
                };
            });

            AddStep($"set distance spacing = {multiplier}", () => snapProvider.DistanceSpacingMultiplier.Value = multiplier);
            AddStep("check correct interval count", () => Assert.That((end_time / grid.DistanceBetweenTicks) * multiplier, Is.EqualTo(grid.MaxIntervals)));
        }