public TrackSegment(TrackNodeAE node, int idx, TSectionDatFile tdf) { tcIndex = new List <int>(); if (node.TCCrossReference != null) { foreach (var tcc in node.TCCrossReference) { tcIndex.Add(tcc.CrossRefIndex); } } TrVectorSection item1 = node.TrVectorNode.TrVectorSections[idx]; TrVectorSection item2 = node.TrVectorNode.TrVectorSections[idx + 1]; A = new MSTSCoord(); A.TileX = item1.TileX; A.TileY = item1.TileZ; A.X = item1.X; A.Y = item1.Z; B = new MSTSCoord(); SectionIdxA = node.TrVectorNode.TrVectorSections[idx].SectionIndex; B.TileX = item2.TileX; B.TileY = item2.TileZ; B.X = item2.X; B.Y = item2.Z; NodeIdx = node.Index; SectionIdxB = (uint)idx + 1; isCurved = false; WorldUid = node.getWorldFileUiD(); CheckCurve(tdf, item1.flag2); }
public TrackSegment(TrackNodeAE nodeA, TrackNodeAE nodeB, TSectionDatFile tdf, int i) { tcIndex = new List <int>(); int direction = DrawUtility.getDirection(nodeA, nodeB); A = nodeA.getMSTSCoord(direction); B = nodeB.getMSTSCoord(direction); NodeIdx = nodeA.Index; SectionIdxB = (uint)i; if (nodeA.TrJunctionNode != null) { direction = DrawUtility.getDirection(nodeB, nodeA); SectionIdxA = nodeB.getSectionIndex(direction); if (nodeB.TCCrossReference != null) { foreach (var tcc in nodeB.TCCrossReference) { tcIndex.Add(tcc.CrossRefIndex); } } } else { SectionIdxA = nodeA.getSectionIndex(direction); if (nodeA.TCCrossReference != null) { foreach (var tcc in nodeA.TCCrossReference) { tcIndex.Add(tcc.CrossRefIndex); } } } isCurved = false; WorldUid = nodeA.getWorldFileUiD(); CheckCurve(tdf, direction); linkToOther = true; }