private void AddFileResources(ContentDirectory source, string extension, FileResourceType type)
 {
     foreach (var file in source.EnumerateFiles(String.Format("*.{0}", extension), SearchOption.AllDirectories))
     {
         AddFileResource(source, type, file);
     }
 }
        private void AddXmlSpriteResources(ContentDirectory source)
        {
            //This ignores the "DB" XML files from the search and considers all other XMl files as sprite files.
            var xmlSpriteFiles =
                source.EnumerateFiles("*.xml", SearchOption.AllDirectories)
                .Where(p => !DredmorInfo.AllContentXmlFiles.Any(q => q == p.Name.ToLower()));

            foreach (var file in xmlSpriteFiles)
            {
                AddFileResource(source, FileResourceType.XmlSprite, file);
            }
        }
        private void AddAnimationResources(ContentDirectory source)
        {
            var animationFirstFrames =
                source.EnumerateFiles("*0000.png", SearchOption.AllDirectories);

            foreach (var file in animationFirstFrames)
            {
                this.Animations.Add(
                    new AnimationResource
                {
                    Name            = file.SourceRelativePath.Replace("0000.png", String.Empty).ToLower().ToForwardSlashes(),
                    FrameCount      = GetAnimationFrameCount(file),
                    ExpansionNumber = file.ExpansionNumber
                }
                    );
            }
        }