Skip to content

Commit

Permalink
Fix function naming
Browse files Browse the repository at this point in the history
  • Loading branch information
kielczykowski-rai committed Dec 9, 2024
1 parent 13bb851 commit 570bc82
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public float DistanceToNextLane
=> CalculateDistanceToNextLane();
public float DistanceToIntersection
=> FirstLaneWithIntersection == null ? float.MaxValue
: DistanceToClosestTrafficLane();
: DistanceToClosestTrafficLightLane();

public bool ObstructedByVehicleBehindIntersection => DistanceToIntersection > DistanceToFrontVehicle;

Expand Down Expand Up @@ -143,7 +143,7 @@ private float CalculateDistanceToNextLane()
return (1f - laneFollowingProgress) * laneLenght;
}

public float DistanceToClosestTrafficLane()
public float DistanceToClosestTrafficLightLane()
{
if (TrafficLightLane is null && !FollowingLanes.Contains(TrafficLightLane))
{
Expand Down Expand Up @@ -179,12 +179,9 @@ public float DistanceToClosestTrafficLane()
}
else
{
//when distance was calculated once partially/for whole lane it keeps calculating whole lanes
//until meeting traffic light lane
distance += laneLenght;
}

//if traffic lane, stop computing
if (FollowingLanes[i] == TrafficLightLane)
{
break;
Expand Down

0 comments on commit 570bc82

Please sign in to comment.