コード例 #1
0
        public CatchEditorTestSceneContainer()
        {
            Anchor  = Anchor.Centre;
            Origin  = Anchor.Centre;
            Width   = CatchPlayfield.WIDTH;
            Height  = 1000;
            Padding = new MarginPadding
            {
                Bottom = 100
            };

            InternalChildren = new Drawable[]
            {
                new ScrollingTestContainer(ScrollingDirection.Down)
                {
                    TimeRange        = 1000,
                    RelativeSizeAxes = Axes.Both,
                    Child            = Playfield = new TestCatchPlayfield
                    {
                        RelativeSizeAxes = Axes.Both
                    }
                },
                new PlayfieldBorder
                {
                    PlayfieldBorderStyle = { Value = PlayfieldBorderStyle.Full },
                    Clock = new FramedClock(new StopwatchClock(true))
                },
                Content = new Container
                {
                    RelativeSizeAxes = Axes.Both
                }
            };
        }
コード例 #2
0
        public void TestSpeedAdjustmentOrdering()
        {
            var hitObjectContainer = new ScrollingPlayfield <TestHitObject, TestJudgement> .ScrollingHitObjectContainer(Axes.X);

            var speedAdjustments = new[]
            {
                new SpeedAdjustmentContainer(new MultiplierControlPoint()),
                new SpeedAdjustmentContainer(new MultiplierControlPoint(1000)
                {
                    TimingPoint = new TimingControlPoint {
                        BeatLength = 500
                    }
                }),
                new SpeedAdjustmentContainer(new MultiplierControlPoint(2000)
                {
                    TimingPoint = new TimingControlPoint {
                        BeatLength = 1000
                    },
                    DifficultyPoint = new DifficultyControlPoint {
                        SpeedMultiplier = 2
                    }
                }),
                new SpeedAdjustmentContainer(new MultiplierControlPoint(3000)
                {
                    TimingPoint = new TimingControlPoint {
                        BeatLength = 1000
                    },
                    DifficultyPoint = new DifficultyControlPoint {
                        SpeedMultiplier = 1
                    }
                }),
            };

            var hitObjects = new[]
            {
                new DrawableTestHitObject(Axes.X, new TestHitObject {
                    StartTime = -1000
                }),
                new DrawableTestHitObject(Axes.X, new TestHitObject()),
                new DrawableTestHitObject(Axes.X, new TestHitObject {
                    StartTime = 1000
                }),
                new DrawableTestHitObject(Axes.X, new TestHitObject {
                    StartTime = 2000
                }),
                new DrawableTestHitObject(Axes.X, new TestHitObject {
                    StartTime = 3000
                }),
                new DrawableTestHitObject(Axes.X, new TestHitObject {
                    StartTime = 4000
                }),
            };

            hitObjects.ForEach(h => hitObjectContainer.Add(h));
            speedAdjustments.ForEach(hitObjectContainer.AddSpeedAdjustment);

            // The 0th index in hitObjectContainer.SpeedAdjustments is the "default" control point
            // Check multiplier of the default speed adjustment
            Assert.AreEqual(1, hitObjectContainer.SpeedAdjustments[0].ControlPoint.Multiplier);
            Assert.AreEqual(1, speedAdjustments[0].ControlPoint.Multiplier);
            Assert.AreEqual(2, speedAdjustments[1].ControlPoint.Multiplier);
            Assert.AreEqual(2, speedAdjustments[2].ControlPoint.Multiplier);
            Assert.AreEqual(1, speedAdjustments[3].ControlPoint.Multiplier);

            // Check insertion of hit objects
            Assert.IsTrue(hitObjectContainer.SpeedAdjustments[4].Contains(hitObjects[0]));
            Assert.IsTrue(hitObjectContainer.SpeedAdjustments[3].Contains(hitObjects[1]));
            Assert.IsTrue(hitObjectContainer.SpeedAdjustments[2].Contains(hitObjects[2]));
            Assert.IsTrue(hitObjectContainer.SpeedAdjustments[1].Contains(hitObjects[3]));
            Assert.IsTrue(hitObjectContainer.SpeedAdjustments[0].Contains(hitObjects[4]));
            Assert.IsTrue(hitObjectContainer.SpeedAdjustments[0].Contains(hitObjects[5]));

            hitObjectContainer.RemoveSpeedAdjustment(hitObjectContainer.SpeedAdjustments[3]);

            // The hit object contained in this speed adjustment should be resorted into the one occuring before it

            Assert.IsTrue(hitObjectContainer.SpeedAdjustments[3].Contains(hitObjects[1]));
        }
コード例 #3
0
 private void applySpeedAdjustment(MultiplierControlPoint controlPoint, ScrollingPlayfield playfield)
 {
     playfield.HitObjects.AddControlPoint(controlPoint);
     playfield.NestedPlayfields?.OfType <ScrollingPlayfield>().ForEach(p => applySpeedAdjustment(controlPoint, p));
 }