public static Formats.Meshes.MeshAttribute ParseMeshAttribute(this SsbhParser parser) { var result = new Formats.Meshes.MeshAttribute(); result.Index = parser.ReadInt32(); result.DataType = (Formats.Meshes.MeshAttribute.AttributeDataType)parser.ReadUInt32(); result.BufferIndex = parser.ReadInt32(); result.BufferOffset = parser.ReadInt32(); result.Unk4 = parser.ReadInt32(); result.Unk5 = parser.ReadInt32(); result.Name = parser.ReadOffsetReadString(); { // TODO: Extract this code to a method? long absoluteOffset = parser.ReadRelativeGetAbsoluteOffset(); long elementCount = parser.ReadInt64(); long previousPosition = parser.Position; parser.Seek(absoluteOffset); result.AttributeStrings = new Formats.SsbhString[elementCount]; for (int i = 0; i < elementCount; i++) { result.AttributeStrings[i] = parser.ParseSsbhString(); } parser.Seek(previousPosition); } return(result); }