SimShift.MapTool.Ets2NavigationSegment.MatchEntry C# (CSharp) Method

MatchEntry() public method

public MatchEntry ( int solI, Ets2NavigationSegment prev ) : bool
solI int
prev Ets2NavigationSegment
return bool
        public bool MatchEntry(int solI, Ets2NavigationSegment prev)
        {
            if (this.Type == Ets2NavigationSegmentType.Road)
            {
                var entryPoint = Options[solI].Points.FirstOrDefault();
                bool res = false;
                foreach (var route in prev.Options)
                {
                    var last = route.Points.LastOrDefault();
                    if (last.CloseTo(entryPoint))
                    {
                        route.EntryLane = this.Options[solI].ExitLane;
                        if (route.ExitLane >= 0 && route.EntryLane >= 0)
                            route.Valid = true;
                        res = true;
                    }
                }

                return res;
            }
            else
            {
                return false;
            }
        }