Пример #1
0
        private IEnumerable <object> GetFileFormats(IPakItem item)
        {
            yield return(item);

            object content;

            if (ContentFactory.TryGetPrimaryContent(item, out content))
            {
                yield return(content);
            }
        }
Пример #2
0
        public static bool TryGetBitmapContent(IPakItem item, out IBitmap content)
        {
            content = null;

            if (item.ItemType != PakItemType.Textures)
            {
                return(false);
            }

            content = new Halo1X.Texture((Halo1X.PakItem)item);

            return(content != null);
        }
Пример #3
0
        private bool FilterTag(string filter, IPakItem item)
        {
            if (string.IsNullOrEmpty(filter))
            {
                return(true);
            }

            if (item.Name.ToUpper() == filter.ToUpper())
            {
                return(true);
            }

            return(false);
        }
Пример #4
0
        public static bool TryGetPrimaryContent(IPakItem item, out object content)
        {
            switch (item.ItemType)
            {
            case PakItemType.Textures:
                IBitmap bitmapContent;
                if (TryGetBitmapContent(item, out bitmapContent))
                {
                    content = bitmapContent;
                    return(true);
                }
                break;
            }

            content = null;
            return(false);
        }
Пример #5
0
 public PakExtractable(IPakItem item, string destination)
 {
     this.item   = item;
     Destination = destination;
 }
Пример #6
0
 internal static ArgumentException NotASaberTextureItem(IPakItem item)
 {
     return(new ArgumentException($"'{item.Name}' is not a texture file."));
 }