示例#1
0
 def read(cls, fp):
     items = []
     while is_readable(fp, 26):
         selector = PathResourceID(read_fmt('H', fp)[0])
         kls = TYPES.get(selector)
         items.append(kls.read(fp))
     return cls(items)
示例#2
0
 def read(cls, fp):
     items = []
     length, operation, _unknown1, _unknown2, index, _unknown3 = read_fmt(
         'HhH2I10s', fp)
     for _ in range(length):
         selector = PathResourceID(read_fmt('H', fp)[0])
         kls = TYPES.get(selector)
         items.append(kls.read(fp))
     return cls(items=items,
                operation=operation,
                index=index,
                unknown1=_unknown1,
                unknown2=_unknown2,
                unknown3=_unknown3)