Changeset 106 for trunk/UTrack.pas
- Timestamp:
- Oct 4, 2022, 3:40:36 PM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTrack.pas
r93 r106 18 18 BaseTrackPoint: TTrackPoint; 19 19 RelPos: Double; 20 function GetTrackPosition: Integer; 20 21 function GetVector: TVector; 21 22 procedure Move(Distance: Double); … … 43 44 function GetLinkDown: TTrackLink; 44 45 function GetLinkUp: TTrackLink; 46 function GetTrackPosition: Integer; 47 45 48 // Move to TTrackLink later 46 49 function GetDistance: Integer; … … 109 112 110 113 { TTrackPosition } 114 115 function TTrackPosition.GetTrackPosition: Integer; 116 begin 117 Result := Round(RelPos); 118 if Assigned(BaseTrackPoint) then 119 Result := Result + BaseTrackPoint.GetTrackPosition; 120 end; 111 121 112 122 function TTrackPosition.GetVector: TVector; … … 411 421 end; 412 422 423 function TTrackPoint.GetTrackPosition: Integer; 424 var 425 Index: Integer; 426 I: Integer; 427 begin 428 Result := 0; 429 Index := Track.Points.IndexOf(Self); 430 for I := 0 to Index - 1 do 431 Result := Result + Track.Points[I].GetDistance; 432 end; 433 413 434 function TTrackPoint.GetDistance: Integer; 414 435 var
Note:
See TracChangeset
for help on using the changeset viewer.