Ejemplo n.º 1
0
        //protected void AddDirectory(DirectoryInfo aDirectoryInfo, string aExtension)
        //{
        //    var aFileInfos = aDirectoryInfo.GetFiles("*" + aExtension);
        //    foreach (var sf in aFileInfos)
        //        this.AddFile(sf);
        //}
        protected void AddDirectory(CSoundDirectoryEnum aSoundDirectoryEnum)
        {
            var aDirectory = GetDirectoryInfo(aSoundDirectoryEnum.GetCustomAttribute <CSoundDirectoryPathAttribute>().Path);
            var aFiles     = this.ContentManager.GetDirectoryContent(aDirectory);

            foreach (var f in aFiles)
            {
                this.AddFile(f);
            }
        }
Ejemplo n.º 2
0
 internal CSoundFile GetRandomSound(CSoundDirectoryEnum aDirectory)
 {
     if (!this.CreateDirectoryDic)
     {
         throw new NotImplementedException();
     }
     else
     {
         var aSounds = this.SoundFileDic[aDirectory].ToArray();
         var aSound  = this.RandomGenerator.NextItem <CSoundFile>(aSounds);
         return(aSound);
     }
 }
Ejemplo n.º 3
0
 internal IEnumerable <CSoundFile> GetSoundFiles(CSoundDirectoryEnum aDirectoryEnum)
 {
     if (!this.CreateDirectoryDic)
     {
         throw new InvalidOperationException();
     }
     else if (this.SoundFileDic.ContainsKey(aDirectoryEnum))
     {
         return(this.SoundFileDic[aDirectoryEnum]);
     }
     else
     {
         return(Array.Empty <CSoundFile>());
     }
 }