MUDEngine:

* Created a FileSystem class. FileSystem acts as a back end class for saving and loading data. Adding additional file types or data management options such as SQL will not be easier to implement by creating a new class that the FileSystem class can use.
 * XmlSerialization class is no longer public. It's changed to internal and has its information passed to it via the FileSystem class.

Project Manager:
 * Project Manager now uses the FileSystem class for saving and loading data instead of the XmlSerialization class.
This commit is contained in:
Scionwest_cp 2009-11-06 17:45:46 -08:00
parent 6004bd0c58
commit 97274cb4aa
5 changed files with 92 additions and 6 deletions

View file

@ -15,14 +15,16 @@ namespace Project_Manager
[STAThread]
static void Main()
{
project = new MUDEngine.ProjectInformation();
//Make sure all our paths are created before we start working with the editor.
MUDEngine.Engine.ValidateProjectPath(Application.StartupPath);
MUDEngine.FileSystem.FileSystem.FileType = MUDEngine.FileSystem.FileSystem.OutputFormats.XML;
project = new MUDEngine.ProjectInformation();
//check if a project file exists, or use the new instance
if (System.IO.File.Exists(Application.StartupPath + @"\Data\project.xml"))
{
project = (MUDEngine.ProjectInformation)MUDEngine.XmlSerialization.Load(Application.StartupPath + @"\Data\project.xml", project);
project = (MUDEngine.ProjectInformation)MUDEngine.FileSystem.FileSystem.Load(Application.StartupPath + @"\Data\project.xml", project);
}
//run the app
@ -30,7 +32,7 @@ namespace Project_Manager
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmMain());
MUDEngine.XmlSerialization.Save(Application.StartupPath + @"\Data\project.xml", project);
MUDEngine.FileSystem.FileSystem.Save(Application.StartupPath + @"\Data\project.xml", project);
}
}
}