Esempio n. 1
0
        public void TestConcurrentObjects()
        {
            var hitObjects = new List <HitObject>();

            var ticks = new List <HitObject>();

            for (int i = 1; i < 10; ++i)
            {
                ticks.Add(new SliderTick {
                    StartTime = 5000 * i, Samples = hitsounded
                });
            }

            var nested = new MockNestableHitObject(ticks.ToList(), 0, 50000)
            {
                Samples = notHitsounded
            };

            nested.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
            hitObjects.Add(nested);

            for (int i = 1; i <= 6; ++i)
            {
                hitObjects.Add(new HitCircle {
                    StartTime = 10000 * i, Samples = notHitsounded
                });
            }

            assertOk(hitObjects);
        }
Esempio n. 2
0
        public void TestNestedObjectsRarelyHitsounded()
        {
            var ticks = new List <HitObject>();

            for (int i = 1; i < 16; ++i)
            {
                ticks.Add(new SliderTick {
                    StartTime = 1000 * i, Samples = i == 0 ? hitsounded : notHitsounded
                });
            }

            var nested = new MockNestableHitObject(ticks.ToList(), 0, 16000)
            {
                Samples = hitsounded
            };

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

            assertLongPeriodWarning(new List <HitObject> {
                nested
            });
        }
Esempio n. 3
0
        public void TestMutedControlPointVolumeSliderTail()
        {
            var sliderHead = new SliderHeadCircle
            {
                StartTime = 0,
                Samples   = new List <HitSampleInfo> {
                    new HitSampleInfo(HitSampleInfo.HIT_NORMAL)
                }
            };

            sliderHead.ApplyDefaults(cpi, new BeatmapDifficulty());

            var sliderTick = new SliderTick
            {
                StartTime = 250,
                Samples   = new List <HitSampleInfo> {
                    new HitSampleInfo("slidertick")
                }
            };

            sliderTick.ApplyDefaults(cpi, new BeatmapDifficulty());

            // Ends after the 5% control point.
            var slider = new MockNestableHitObject(new List <HitObject> {
                sliderHead, sliderTick,
            }, startTime: 0, endTime: 2500)
            {
                Samples = new List <HitSampleInfo> {
                    new HitSampleInfo(HitSampleInfo.HIT_NORMAL)
                }
            };

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

            assertMutedPassive(new List <HitObject> {
                slider
            });
        }
Esempio n. 4
0
        public void TestMutedControlPointVolumeSliderHead()
        {
            var sliderHead = new SliderHeadCircle
            {
                StartTime = 2000,
                Samples   = new List <HitSampleInfo> {
                    new HitSampleInfo(HitSampleInfo.HIT_NORMAL)
                }
            };

            sliderHead.ApplyDefaults(cpi, new BeatmapDifficulty());

            var sliderTick = new SliderTick
            {
                StartTime = 2250,
                Samples   = new List <HitSampleInfo> {
                    new HitSampleInfo("slidertick")
                }
            };

            sliderTick.ApplyDefaults(cpi, new BeatmapDifficulty());

            var slider = new MockNestableHitObject(new List <HitObject> {
                sliderHead, sliderTick,
            }, startTime: 2000, endTime: 2500)
            {
                Samples = new List <HitSampleInfo> {
                    new HitSampleInfo(HitSampleInfo.HIT_NORMAL, volume: volume_regular)
                }
            };

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

            assertMuted(new List <HitObject> {
                slider
            });
        }
Esempio n. 5
0
        public void TestMutedSampleVolumeSliderTail()
        {
            var sliderHead = new SliderHeadCircle
            {
                StartTime = 0,
                Samples   = new List <HitSampleInfo> {
                    new HitSampleInfo(HitSampleInfo.HIT_NORMAL)
                }
            };

            sliderHead.ApplyDefaults(cpi, new BeatmapDifficulty());

            var sliderTick = new SliderTick
            {
                StartTime = 250,
                Samples   = new List <HitSampleInfo> {
                    new HitSampleInfo("slidertick")
                }
            };

            sliderTick.ApplyDefaults(cpi, new BeatmapDifficulty());

            var slider = new MockNestableHitObject(new List <HitObject> {
                sliderHead, sliderTick,
            }, startTime: 0, endTime: 2500)
            {
                Samples = new List <HitSampleInfo> {
                    new HitSampleInfo(HitSampleInfo.HIT_NORMAL, volume: volume_muted)
                }                                                                                                       // Applies to the tail.
            };

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

            assertMutedPassive(new List <HitObject> {
                slider
            });
        }
Esempio n. 6
0
        public void TestNormalSampleVolumeSlider()
        {
            var sliderHead = new SliderHeadCircle
            {
                StartTime = 0,
                Samples   = new List <HitSampleInfo> {
                    new HitSampleInfo(HitSampleInfo.HIT_NORMAL)
                }
            };

            sliderHead.ApplyDefaults(cpi, new BeatmapDifficulty());

            var sliderTick = new SliderTick
            {
                StartTime = 250,
                Samples   = new List <HitSampleInfo> {
                    new HitSampleInfo("slidertick", volume: volume_muted)
                }                                                                                           // Should be fine.
            };

            sliderTick.ApplyDefaults(cpi, new BeatmapDifficulty());

            var slider = new MockNestableHitObject(new List <HitObject> {
                sliderHead, sliderTick,
            }, startTime: 0, endTime: 500)
            {
                Samples = new List <HitSampleInfo> {
                    new HitSampleInfo(HitSampleInfo.HIT_NORMAL)
                }
            };

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

            assertOk(new List <HitObject> {
                slider
            });
        }