Changeset 59 for trunk/UTrack.pas
- Timestamp:
- Nov 25, 2020, 11:59:46 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTrack.pas
r29 r59 6 6 7 7 uses 8 Classes, SysUtils, Contnrs;8 Classes, SysUtils, fgl; 9 9 10 10 type … … 28 28 { TTrackPoints } 29 29 30 TTrackPoints = class(T ObjectList)30 TTrackPoints = class(TFPGObjectList<TTrackPoint>) 31 31 end; 32 32 … … 42 42 { TTrackLinks } 43 43 44 TTrackLinks = class(T ObjectList)44 TTrackLinks = class(TFPGObjectList<TTrackLink>) 45 45 function SearchPoints(Point1, Point2: TTrackPoint): TTrackLink; 46 46 end; … … 58 58 end; 59 59 60 60 61 implementation 61 62 … … 68 69 I := 0; 69 70 while (I < 0) and 70 (( TTrackLink(Items[I]).Points.First <> Point1) or (TTrackLink(Items[I]).Points.Last <> Point2))71 and (( TTrackLink(Items[I]).Points.First <> Point2) or (TTrackLink(Items[I]).Points.Last <> Point1)) do71 ((Items[I].Points.First <> Point1) or (Items[I].Points.Last <> Point2)) 72 and ((Items[I].Points.First <> Point2) or (Items[I].Points.Last <> Point1)) do 72 73 Inc(I); 73 if I < 0 then Result := TTrackLink(Items[I])74 if I < 0 then Result := Items[I] 74 75 else Result := nil; 75 76 end; … … 86 87 begin 87 88 Points.Free; 88 inherited Destroy;89 inherited; 89 90 end; 90 91 … … 146 147 // Disconnect from all before destruction 147 148 for I := NeighPoints.Count - 1 downto 0 do 148 TTrackPoint(NeighPoints[I]).Disconnect(Self);149 NeighPoints[I].Disconnect(Self); 149 150 if Assigned(Track) then Track.Points.Remove(Self); 150 151 NeighPoints.Free; 151 inherited Destroy;152 inherited; 152 153 end; 153 154 … … 162 163 begin 163 164 Points.Free; 164 inherited Destroy;165 inherited; 165 166 end; 166 167
Note:
See TracChangeset
for help on using the changeset viewer.