Example #1
0
        public virtual void SetPriority(DataComperativeCars comperative, Actor settingCar)
        {
            //TrafficLight trafficSignal = ToolBox.Get<TrafficLightManager>().PosTL[settingCar.Position];

            //Car observeCarLeft;
            //Car observeCarRight;


            //if (trafficSignal == TrafficLight.Red)
            //{
            //    if (comperative.ContainsKey(ComperativeLocation.Left) || comperative.ContainsKey(ComperativeLocation.Right))
            //    {
            //        settingCar.priority++;[0]
            //    }

            //    if (comperative.TryGetValue(ComperativeLocation.Left, out observeCarLeft) && comperative.TryGetValue(ComperativeLocation.Right, out observeCarRight))
            //    {
            //        if (observeCarLeft.Direction == Direction.Left && observeCarRight.Direction != Direction.Left)
            //        {
            //            settingCar.priority++;[1]
            //        }
            //        else if (observeCarRight.Direction == Direction.Left && observeCarLeft.Direction != Direction.Left)
            //        {
            //            settingCar.priority++;[2]
            //        }

            //    }

            //}
        }
Example #2
0
        public void SetPriority(DataComperativeCars comperative, Actor settingCar)
        {
            Situation observeCar;

            if (comperative.comperative.TryGetValue(ComperativePos.Right, out observeCar))
            {
                settingCar.Get <DataPriority>().priority++;//+tested[0]

                if (observeCar.direction.direction == Direction.Forward)
                {
                    if (comperative.comperative.TryGetValue(ComperativePos.Front, out observeCar))
                    {
                        settingCar.Get <DataPriority>().priority++;//+tested[1]
                    }
                }
                else if (observeCar.direction.direction == Direction.Left)
                {
                    if (comperative.comperative.TryGetValue(ComperativePos.Front, out observeCar))
                    {
                        settingCar.Get <DataPriority>().priority++;//+tested[2]
                    }
                    else if (comperative.comperative.TryGetValue(ComperativePos.Left, out observeCar))
                    {
                        if (observeCar.direction.direction == Direction.Right)
                        {
                            settingCar.Get <DataPriority>().priority++;//+tested[3]
                        }
                    }
                }
            }
        }
Example #3
0
        public override void SetPriority(DataComperativeCars comperative, Actor settingCar)
        {
            //Car observeCar;
            //base.SetPriority(comperative, settingCar);

            //if (comperative.TryGetValue(ComperativeLocation.Front, out observeCar))
            //{
            //    if (observeCar.Direction != Direction.Left)
            //    {
            //        settingCar.priority++;[0]
            //    }
            //}
        }
Example #4
0
 public void SetPriority(DataComperativeCars comperative, Actor settingCar)
 {
 }