예제 #1
0
        public static int GetStartInstruction(Route r, int i, ILanguageReference languageReference, out Instruction instruction)
        {
            instruction = (Instruction)null;
            if (i != 0 || r.Segments.Count <= 0)
            {
                return(0);
            }
            DirectionEnum directionEnum = DirectionCalculator.Calculate(new GeoCoordinate((double)r.Segments[0].Latitude, (double)r.Segments[0].Longitude), new GeoCoordinate((double)r.Segments[1].Latitude, (double)r.Segments[1].Longitude));
            string        str           = languageReference[directionEnum.ToInvariantString()];

            instruction = new Instruction()
            {
                Text    = string.Format(languageReference["Start {0}."], (object)str),
                Type    = "start",
                Segment = 0
            };
            return(1);
        }