Example #1
0
        protected override void AddTraffic()
        {
            BusPath busPath = Lane.Paths[PathIndex] as BusPath;

            if (busPath != null)
            {
                Target.TrafficLight.AddTraffic(this, busPath.PathDirection.GetHashCode());
            }
            else
            {
                Target.TrafficLight.AddTraffic(this);
            }
        }
Example #2
0
        protected override bool LightIsGreen()
        {
            BusPath busPath = Lane.Paths[PathIndex] as BusPath;

            if (busPath != null) // Driving on a buslane
            {
                return(Target.TrafficLight == null || busPath.AllowedWithStatus(Target.TrafficLight.Status));
            }
            else
            {
                return(Target.TrafficLight == null || Target.TrafficLight.Status == 2);
            }
        }