コード例 #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());
        }