Example #1
0
        protected void GoNext()
        {
            if (PrevNode != NextNode)
            {
                _nodes.Add(NextNode);
            }

            var current = NextNode;

            PrevNode = current;

            (_routeIndex, NextNode) = Route.Next(_routeIndex);
            CurrentPath             = current.Connections[NextNode];
            CurrentLane             = CurrentPath.GetLaneTo(NextNode);
            CurrentLane.Enter(this);
            _lanes.Add(CurrentLane);
            _following = CurrentLane.GetVehicleAhead(this);
            if (_following != null)
            {
                _following.DepartedLane += Unfollow;
            }

            FrontPos = 0;

            _action = FollowPath;
        }