예제 #1
0
 public void TestBeatRandomizer()
 {
     var settings        = GetRandomizerSettings(RandomizerTestUtil.config9Panel);
     var randomizer      = new BeatRandomizer(settings);
     var notes           = GenerateNotes(4);
     var randomizedNotes = randomizer.RandomizeBeat(notes);
 }
예제 #2
0
        public void CannotGenerateMoreNotesThanAvailableInPanelConfig()
        {
            var settings        = GetRandomizerSettings(RandomizerTestUtil.config1Panel);
            var randomizer      = new BeatRandomizer(settings);
            var notes           = GenerateNotes(2);
            var randomizedNotes = randomizer.RandomizeBeat(notes);

            Assert.IsTrue(randomizedNotes.Count <= 1);
        }
예제 #3
0
        public void CannotGenerateMoreThan2Notes()
        {
            var settings        = GetRandomizerSettings(RandomizerTestUtil.config9Panel);
            var randomizer      = new BeatRandomizer(settings);
            var notes           = GenerateNotes(3);
            var randomizedNotes = randomizer.RandomizeBeat(notes);

            Assert.IsTrue(randomizedNotes.Count <= 2);
        }
예제 #4
0
        private static List <PanelNote> PressNote(BeatRandomizer randomizer, int beat)
        {
            var notes = new List <Note>()
            {
                new Note(NoteType.Regular, beat)
            };

            return(randomizer.RandomizeBeat(notes));
        }
예제 #5
0
        private List <PanelNote> HoldNote(BeatRandomizer randomizer, int beat, int duration)
        {
            var notes = new List <Note>()
            {
                new Note(NoteType.Hold, beat, duration)
            };

            return(randomizer.RandomizeBeat(notes));
        }
예제 #6
0
        public void CannotGenerateDuplicateNotes()
        {
            var settings        = GetRandomizerSettings(RandomizerTestUtil.config9Panel);
            var randomizer      = new BeatRandomizer(settings);
            var notes           = GenerateNotes(4);
            var randomizedNotes = randomizer.RandomizeBeat(notes);
            var distinctNotes   = randomizedNotes.Select(x => x.panel).Distinct();

            Assert.AreEqual(randomizedNotes.Count, distinctNotes.Count());
        }
예제 #7
0
        protected int[] RandomizeNote(BeatRandomizer randomizer)
        {
            var notes = new List <Note>()
            {
                new Note(NoteType.Regular, 0)
            };
            var randomizedNote = randomizer.RandomizeBeat(notes).Single();

            return(PanelConfigUtil.GetPanelIndices(randomizedNote.panel));
        }