Esempio n. 1
0
        public MapaProvider(CoordenadasProvider coordenadasProvider, MoverPjProvider moverPjProvider, ILogger log) : base(null, null, log)
        {
            this.coordenadasProvider = coordenadasProvider;
            this.moverPjProvider     = moverPjProvider;
            this.mapa = new Mapa();

            var         _filePath = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory);
            List <Nodo> nodos;

            using (var streamReader = File.OpenText(_filePath + "\\Mapa\\mapa.txt"))
            {
                var lines = streamReader.ReadToEnd();
                nodos = JsonConvert.DeserializeObject <List <Nodo> >(lines);
            }

            foreach (var nodo in nodos)
            {
                if (Nodo.RadioGeneral == 0)
                {
                    Nodo.RadioGeneral = nodo.Radio;
                }
                mapa.AgregarNodo(nodo);
            }
        }