Exemple #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]);
            }
        }
Exemple #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);
        }
Exemple #3
0
 public Tag(TagEntry entry)
 {
     entry_ = entry;
 }
Exemple #4
0
 public Tag(TagEntry entry)
 {
     entry_ = entry;
 }
Exemple #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;
 }