Example #1
0
        public void ReadAll()
        {
            string line;

            while ((line = _reader.ReadLine()) != null)
            {
                string[] fields = line.Split(Separator.ToCharArray());

                theClass          = new LocationFile();
                theClass.Nation   = fields[0];
                theClass.Language = fields[1];
                theClass.DatFile  = fields[2];
                theClass.Fallback = fields[3];


                theList.Add(theClass);
            }
        }
        public void Load(string lang, string face)
        {
            _reader = new AllFacesReader("AllFaces.dat", _faces);
            _reader.ReadAll();

            _locreader = new AllLocationFilesReader("AllLocationsFiles.dat", _locs);
            _locreader.ReadAll();

            var loc = from f in _locs where _nation == f.Nation select f;

            if (loc != null)
            {
                try
                {
                    LocationFile l = loc.First();

                    _placesreader = new PlacesReader(l.DatFile, _places);
                }
                catch
                {
                    try
                    {
                        LocationFile l = loc.First();

                        _placesreader = new PlacesReader(l.Fallback, _places);
                    }
                    catch
                    {
                        throw new System.Exception("No hay fichero de Localizaciones");
                    }
                }
            }
            else
            {
                throw new System.Exception("No hay fichero de Localizaciones o los parametros elegidos son incorrectos. Revise AllLocationFiles.dat");
            }
        }