Exemplo n.º 1
0
        public SmxTagTable(FileHeader file, SectionEntry header, SmxNameTable names)
            : base(file, header)
        {
            var tags = TagEntry.From(file.SectionReader(header), header, names);

            tags_ = new Tag[tags.Length];
            for (var i = 0; i < tags.Length; i++)
            {
                tags_[i] = new Tag(tags[i]);
            }
        }
Exemplo n.º 2
0
        public static TagEntry[] From(BinaryReader rd, SectionEntry header, SmxNameTable names)
        {
            if (header.Size % Size != 0)
            {
                throw new Exception("invalid tag table size");
            }
            var count   = header.Size / Size;
            var entries = new TagEntry[count];

            for (var i = 0; i < count; i++)
            {
                var entry = new TagEntry();
                entry.tag      = rd.ReadUInt32();
                entry.nameoffs = rd.ReadInt32();
                entry.name     = names.StringAt(entry.nameoffs);
                entries[i]     = entry;
            }
            return(entries);
        }
Exemplo n.º 3
0
 public Tag(TagEntry entry)
 {
     entry_ = entry;
 }
Exemplo n.º 4
0
 public Tag(TagEntry entry)
 {
     entry_ = entry;
 }
Exemplo n.º 5
0
 public static TagEntry[] From(BinaryReader rd, SectionEntry header, SmxNameTable names)
 {
     if (header.Size % Size != 0)
         throw new Exception("invalid tag table size");
     var count = header.Size / Size;
     var entries = new TagEntry[count];
     for (var i = 0; i < count; i++)
     {
         var entry = new TagEntry();
         entry.tag = rd.ReadUInt32();
         entry.nameoffs = rd.ReadInt32();
         entry.name = names.StringAt(entry.nameoffs);
         entries[i] = entry;
     }
     return entries;
 }