Ejemplo n.º 1
0
        public DataSelector(string x = "5.727775", string y = "45.185541", string d = "1000", bool apiData = true)
        {
            _longX = x;
            _latY  = y;
            _dist  = d;

            if (apiData == true)
            {
                _connectMetroAPIStations = new ConnectMetroAPI("https://data.metromobilite.fr/api/linesNear/json?x=" + _longX + "&y=" + _latY + "&dist=" + _dist + "&details=true");
                _connectMetroAPILines    = new ConnectMetroAPI("https://data.metromobilite.fr/api/routers/default/index/routes");
            }
            else
            {
                _connectMetroAPIStations = new ConnectMetroAPIFake_StationsCCI600();
                _connectMetroAPILines    = new ConnectMetroAPIFake_AllLines();
            }

            _stations = new Stations(_connectMetroAPIStations);
            _lines    = new Lines(_connectMetroAPILines);
        }
 public Lines(IConnectMetroAPI rawData)
 {
     //convert json string to list of objects based on LineModel
     _deserializedLines = JsonConvert.DeserializeObject <List <LineModel> >(rawData.GetRawData());
 }
Ejemplo n.º 3
0
 public Stations(IConnectMetroAPI rawData)
 {
     //convert json string to list of objects based on StationModel
     _deserializedStations = JsonConvert.DeserializeObject <List <StationModel> >(rawData.GetRawData());
 }