Designer:

- Corrected Project Information not being displayed when loaded for editing
 - Re-wrote Designer Save code to use the objects save code instead of FileManager. Resulted in 26% less code and cleaner source.
 - Project Explorer now checks Saved State of currently loaded object just like the Right-Click->Edit Object menu item does.

Engine:
 - ProjectInformation.Save() now implemented.
 - BaseObject.Save() now implemented. All objects inheriting from BaseObject can save itself. Including all Environment objects (Realms,Zones, Rooms) and Currency objects.
This commit is contained in:
Scionwest_cp 2010-01-18 21:31:47 -08:00
parent 42e6fef109
commit a98e2bc069
3 changed files with 52 additions and 49 deletions

View file

@ -159,6 +159,11 @@ namespace MudDesigner.MudEngine.GameObjects
#endregion
#region Public Methods
/// <summary>
/// Loads the supplied filename and returns it.
/// </summary>
/// <param name="filename"></param>
/// <returns></returns>
public object Load(string filename)
{
if (!File.Exists(filename))
@ -169,8 +174,16 @@ namespace MudDesigner.MudEngine.GameObjects
return FileManager.Load(filename, this);
}
/// <summary>
/// Saves the current object with the supplied filename
/// </summary>
/// <param name="filename"></param>
public void Save(string filename)
{
string directory = Path.GetDirectoryName(filename);
if (!Directory.Exists(directory))
Directory.CreateDirectory(directory);
FileManager.Save(filename, this);
}
public override string ToString()
{