public override void Save(StreamWriter sw, VarCollection vars)
{
sw.WriteLine("Tileset:" + name);
sw.WriteLine("\ttype:1");
if (vars.Vars[rootPath] == null)
sw.WriteLine("\trootpath:" + rootPath);
else
sw.WriteLine("\trootpath:" + ((Variable)vars.Vars[rootPath]).Name);
if (vars.Vars[rmpPath] == null)
sw.WriteLine("\trmpPath:" + rootPath);
else
sw.WriteLine("\trmpPath:" + ((Variable)vars.Vars[rmpPath]).Name);
if (vars.Vars[blankPath] == null)
sw.WriteLine("\tblankPath:" + blankPath);
else
sw.WriteLine("\tblankPath:" + ((Variable)vars.Vars[blankPath]).Name);
sw.WriteLine("\tpalette:" + myPal.Name);
foreach (string str in subsets.Keys)
{
Dictionary<string, IMapDesc> h = subsets[str];
if (h == null)
continue;
VarCollection vc = new VarCollection("Deps");
foreach (string s in h.Keys)
{
XCMapDesc id = (XCMapDesc)maps[s];
if (id == null)
continue;
string depList = "";
if (id.Dependencies.Length > 0)
{
int i = 0;
for (; i < id.Dependencies.Length - 1; i++)
depList += id.Dependencies[i] + " ";
depList += id.Dependencies[i];
}
vc.AddVar(id.Name, depList);
}
sw.WriteLine("\tfiles:" + str);
foreach (string vKey in vc.Variables)
((Variable)vc.Vars[vKey]).Write(sw, "\t\t");
sw.WriteLine("\tend");
}
sw.WriteLine("end\n");
sw.Flush();
}