Exemplo n.º 1
0
        public Dictionary <string, StationInfo> GetStationInfos(int dist)
        {
            Dictionary <string, StationInfo> myDict = new Dictionary <string, StationInfo>();

            Dictionary <string, Station> stationDict = _stationsProvider.GetStations(dist);

            List <string> sLines = new List <string>();

            foreach (KeyValuePair <string, Station> kvp in stationDict)
            {
                foreach (string sLine in kvp.Value.lines)
                {
                    if (!sLines.Contains(sLine))
                    {
                        sLines.Add(sLine);
                    }
                }
            }

            Dictionary <string, Line> lineDict = _lineProvider.getLines(sLines);

            foreach (KeyValuePair <string, Station> kvp in stationDict)
            {
                List <Line> lines = new List <Line>();

                foreach (string sLine in kvp.Value.lines)
                {
                    lines.Add(lineDict[sLine]);
                }

                myDict.Add(kvp.Key, new StationInfo(kvp.Value.id, kvp.Value.name, kvp.Value.lon, kvp.Value.lat, lines));
            }

            return(myDict);
        }
Exemplo n.º 2
0
 public Dictionary <string, Station> GetStations(int dist)
 {
     return(_stationsProvider.GetStations(dist));
 }