public static WTSpline ReadBinary(BinaryReader reader) { var spline = new WTSpline { Name = reader.ReadNullTerminatedString() }; spline.Position = reader.ReadVector3(); int subSplineCount = reader.ReadUInt16(); for (int j = 0; j < subSplineCount; j++) { var subspline = WTSubSpline.ReadBinary(reader); spline.SubSplines.Add(subspline); } bool additionalString = reader.ReadUInt16() != 0; if (additionalString) { string additionalStringval = reader.ReadNullTerminatedString(); spline.Reference = additionalStringval; } return(spline); }
public static WTSubSpline ReadBinary(BinaryReader reader) { var subspline = new WTSubSpline(); int subSplinePtCount = reader.ReadUInt16(); subspline.Closed = reader.ReadByte() != 0; for (int k = 0; k < subSplinePtCount; k++) { subspline.Points.Add(reader.ReadVector3()); } return(subspline); }