Inheritance: FileDesc
Beispiel #1
0
        public static void Init(Palette p, DSShared.PathInfo paths)
        {
            currentPalette = p;
            pckHash        = new Dictionary <Palette, Dictionary <string, PckFile> >();

            VarCollection vars = new VarCollection(new StreamReader(File.OpenRead(paths.ToString())));

            Directory.SetCurrentDirectory(paths.Path);

            xConsole.Init(20);
            KeyVal kv = null;

            while ((kv = vars.ReadLine()) != null)
            {
                switch (kv.Keyword)
                {
                case "mapdata":                         /* mapedit */
                    tileInfo = new TilesetDesc(kv.Rest, vars);
                    break;

                case "images":                         /* mapedit */
                    imageInfo = new ImageInfo(kv.Rest, vars);
                    break;

                default:
                    if (ParseLine != null)
                    {
                        ParseLine(kv, vars);
                    }
                    else
                    {
                        xConsole.AddLine("Error in paths file: " + kv);
                    }
                    break;
                }
            }

            vars.BaseStream.Close();
        }
Beispiel #2
0
		public static void Init(Palette p, DSShared.PathInfo paths)
		{
			currentPalette = p;
			pckHash = new Dictionary<Palette, Dictionary<string, PckFile>>();		

			VarCollection vars = new VarCollection(new StreamReader(File.OpenRead(paths.ToString())));

			Directory.SetCurrentDirectory(paths.Path);

			xConsole.Init(20);
			KeyVal kv = null;

			while((kv=vars.ReadLine())!=null)
			{
				switch (kv.Keyword)
				{					
		/* mapedit */case "mapdata":
						tileInfo = new TilesetDesc(kv.Rest, vars);
						break;
		/* mapedit */case "images": 
						imageInfo = new ImageInfo(kv.Rest, vars); 
						break;
					case "useBlanks":
						Globals.UseBlanks = bool.Parse(kv.Rest);
						break;
					default:
						if (ParseLine != null)
							ParseLine(kv, vars);
						else
							xConsole.AddLine("Error in paths file: " + kv);
						break;
				}
			}

			vars.BaseStream.Close();
		}