Ejemplo n.º 1
0
        public static ImportedFile Convert(string[] items)
        {
            ImportedFile list = new ImportedFile();

            foreach (var item in items)
            {
                if (item.IndexOf("war3map.") != -1)
                {
                    continue;
                }
                list.Add(new Data
                {
                    UseCustomPath = item.IndexOf("war3mapImported\\") != 0,
                    Path          = item
                });
            }
            return(list);
        }
Ejemplo n.º 2
0
        public static ImportedFile Parse(byte[] data)
        {
            ImportedFile list = new ImportedFile();

            using (ByteStream bs = new ByteStream(data))
            {
                bs.ReadInt32();
                int LoopCount = bs.ReadInt32();
                for (int i = 0; i < LoopCount; i++)
                {
                    Data item          = new Data();
                    byte UseCustomPath = bs.ReadByte();
                    item.UseCustomPath = UseCustomPath == 0xA || UseCustomPath == 0xD;
                    item.Path          = bs.ReadString();
                    list.Add(item);
                }
            }
            return(list);
        }