public AudioGroup(params AudioFile[] files) { checkFileQueue(); foreach (AudioFile file in files) { fileQueue.Enqueue(file); } }
public void RandomizedQueueTest() { for (var k = 0; k < 9; k++) { var q = new RandomizedQueue<string>(); var items = new List<string> { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" }; foreach (var item in items) { q.Enqueue(item); } var array = new List<string>(); for (var i = 0; i < k; i++) { array.Add(q.Dequeue()); } Assert.AreEqual(k, array.Distinct().Count()); } }
static void Main(string[] args) { var queue = new RandomizedQueue<string>(); queue.Enqueue("Item1"); queue.Enqueue("Item2"); queue.Enqueue("Item3"); queue.Enqueue("Item4"); queue.Enqueue("Item5"); queue.Enqueue("Item6"); queue.Enqueue("Item7"); foreach (var item in queue) { Console.WriteLine(item); } for (int i = 0; i < 7; i++) { Console.WriteLine(queue.Dequeue()); } }
void initCyclingAudio () { _sweeteners = new RandomizedQueue<AudioFile>(); _swells = new RandomizedQueue<AudioFile>(); _GUIclicks = new RandomizedQueue<AudioFile>(); _matey = new RandomizedQueue<AudioFile>(); _ambienceMain = new RandomizedQueue<AudioFile>(); _ambienceTutorial = new RandomizedQueue<AudioFile>(); _swabbie = new RandomizedQueue<AudioFile>(); _firstMate = new RandomizedQueue<AudioFile>(); _swabbieSpeech = new RandomizedQueue<AudioFile>(); _quarterMaster = new RandomizedQueue<AudioFile>(); _rigger = new RandomizedQueue<AudioFile>(); _secondMate = new RandomizedQueue<AudioFile>(); _oj = new RandomizedQueue<AudioFile>(); _sadieAhoy = new RandomizedQueue<AudioFile>(); _sadieTalk = new RandomizedQueue<AudioFile>(); _shipmaster = new RandomizedQueue<AudioFile>(); // Init Queue's with sound files List<AudioFile> list = new List<AudioFile>(); // Get all deck music playEvents.TryGetValue ("onesoundtrackevery100to200seconds",out list); foreach (AudioFile track in list) { _swells.Enqueue (track); } playEvents.TryGetValue ("every8to20seconds",out list); foreach (AudioFile track in list) { _sweeteners.Enqueue (track); } // Get all GUI click sounds playEvents.TryGetValue ("GUI Click",out list); foreach (AudioFile track in list) { _GUIclicks.Enqueue (track); } // Get all matey sounds playEvents.TryGetValue ("MateyButton",out list); foreach (AudioFile track in list) { _matey.Enqueue (track); } // Get ambience playEvents.TryGetValue ("EnterTutorial",out list); foreach (AudioFile track in list) { _ambienceTutorial.Enqueue (track); } playEvents.TryGetValue ("enterscene",out list); foreach (AudioFile track in list) { _ambienceMain.Enqueue (track); } // Get swabbie mopping sound playEvents.TryGetValue ("MopOnFloor",out list); foreach (AudioFile track in list) { _swabbie.Enqueue (track); } // Speaking voice effects playEvents.TryGetValue ("FirstMateSpeech",out list); foreach (AudioFile track in list) { _firstMate.Enqueue (track); } playEvents.TryGetValue ("SwabbieTalk",out list); foreach (AudioFile track in list) { _swabbieSpeech.Enqueue (track); } playEvents.TryGetValue ("RiggerTalk",out list); foreach (AudioFile track in list) { _rigger.Enqueue (track); } playEvents.TryGetValue ("QuartermasterTalk",out list); foreach (AudioFile track in list) { _quarterMaster.Enqueue (track); } playEvents.TryGetValue ("SecondmateTalks",out list); foreach (AudioFile track in list) { _secondMate.Enqueue (track); } playEvents.TryGetValue ("OJTalk",out list); foreach (AudioFile track in list) { _oj.Enqueue (track); } playEvents.TryGetValue ("SadieAhoy",out list); foreach (AudioFile track in list) { _sadieAhoy.Enqueue (track); } playEvents.TryGetValue ("SadieTalk",out list); foreach (AudioFile track in list) { _sadieTalk.Enqueue (track); } playEvents.TryGetValue ("ShipmasterTalk",out list); foreach (AudioFile track in list) { _shipmaster.Enqueue (track); } }