コード例 #1
0
        public static int GetLeft(IList <MicroPlannerMessage> messages, IRoutingInterpreter interpreter)
        {
            int left = 0;

            foreach (MicroPlannerMessage message in messages)
            {
                if (message is MicroPlannerMessagePoint)
                {
                    MicroPlannerMessagePoint point = (message as MicroPlannerMessagePoint);
                    left = left + MicroPlannerHelper.GetLeft(point, interpreter);
                }
            }
            return(left);
        }
コード例 #2
0
        public static int GetStraightOn(IList <MicroPlannerMessage> messages, IRoutingInterpreter interpreter)
        {
            int straight = 0;

            foreach (MicroPlannerMessage message in messages)
            {
                if (message is MicroPlannerMessagePoint)
                {
                    MicroPlannerMessagePoint point = (message as MicroPlannerMessagePoint);
                    straight = straight + MicroPlannerHelper.GetStraightOn(point, interpreter);
                }
            }
            return(straight);
        }
コード例 #3
0
        public static int GetStraightOn(MicroPlannerMessagePoint point, IRoutingInterpreter interpreter)
        {
            int straight = 0;

            if (point.Point.ArcsNotTaken != null)
            {
                foreach (KeyValuePair <RelativeDirection, AggregatedArc> arc_pair in point.Point.ArcsNotTaken)
                {
                    if (!MicroPlannerHelper.IsTurn(arc_pair.Key.Direction, interpreter))
                    {
                        if (interpreter.EdgeInterpreter.IsRoutable(arc_pair.Value.Tags))
                        {
                            straight++;
                        }
                    }
                }
            }
            return(straight);
        }