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