Esempio n. 1
0
        public void setCurrentLane(Lane lane)
        {
            currentLane = lane;
            if (lane.getRoad() != currentLane.getRoad())
            {
                currentRoad = lane.getRoad();
            }

            Road nextRoad = getNextRoad();

            if (nextRoad != null)
            {
                willNearTurn = Util.getRltDirection(currentRoad.direction, nextRoad.direction) == RltDirection.Right;
                willFarTurn  = Util.getRltDirection(currentRoad.direction, nextRoad.direction) == RltDirection.Left;
            }
        }
 public Lane getRightAdjacentLane(Lane lane)
 {
     if (lane.getRoad() != this)
     {
         return(null);
     }
     else
     {
         Lane tempLane = getRightmostLane();
         for (int i = 0; i < numOfLanes; i++)
         {
             if (lane == lanes[i] && i < numOfLanes - 1)
             {
                 tempLane = lanes[i + 1];
             }
         }
         return(tempLane);
     }
 }