예제 #1
0
파일: Program.cs 프로젝트: monsterNY/vlxm
        private static void TestInsertionSortList()
        {
            InsertionSortList instance = new InsertionSortList();

            Console.WriteLine(instance.Solution(new[] { 3, 2, 4 }));
            Console.WriteLine(instance.Solution(new[] { 4, 2, 1, 3 }));
        }
예제 #2
0
        public void TestInsertionSortList()
        {
            var head  = MyLinkList.BuildListNodeFromArray(new[] { 3, 5, 2, 6, 7, 4, 1 });
            var dummy = InsertionSortList.Sort(head);

            Assert.AreEqual(dummy.Next.Val, 1);
            Assert.AreEqual(dummy.Next.Next.Next.Val, 3);
            Assert.AreEqual(dummy.Next.Next.Next.Next.Next.Val, 5);
            Assert.AreEqual(dummy.Next.Next.Next.Next.Next.Next.Next.Val, 7);
        }
예제 #3
0
        public SoundSystem(Vector2 minMaxDistance, int maxAudibleVoices, CustomReadFileMethodDelegate customReadFileMethod)
        {
            _3DMinMaxDistance    = minMaxDistance;
            CustomReadFileMethod = customReadFileMethod;

#if DEBUG_JMOD
            AudioDevice = new XAudio2(XAudio2Flags.DebugEngine, ProcessorSpecifier.AnyProcessor);
#else
            AudioDevice = new XAudio2(XAudio2Flags.None, ProcessorSpecifier.AnyProcessor);
#endif

            freeVoices = new Stack <SourceVoiceSlot>(maxAudibleVoices);
            usedVoices = new InsertionSortList <SourceVoiceSlot>(new SourceVoiceSlot.SlotComparer());
            for (int i = 0; i < maxAudibleVoices; i++)
            {
                freeVoices.Push(new SourceVoiceSlot(this));
            }
            virtualChannels = new InsertionSortList <Channel>(new Channel.ImportanceComparer());
        }