All of the classes that currently perform Save/Load operations now log when a Property failed to be loaded correctly.

This commit is contained in:
Scionwest_cp 2012-03-10 19:48:41 -08:00
parent 32210124e0
commit a6d346da3d
5 changed files with 28 additions and 49 deletions

View file

@ -67,22 +67,19 @@ namespace MudEngine.GameScripts
public virtual void Load(String filename)
{
try
{
if (!File.Exists(filename))
return;
this.SaveData.Load(filename);
this.Name = this.SaveData.GetData("Name");
this.ID = this.SaveData.GetData("ID");
this.Description = this.SaveData.GetData("Description");
}
catch (Exception ex)
{
Logger.WriteLine(ex.Message);
if (!File.Exists(filename))
return;
}
return;
this.SaveData.Load(filename);
try { this.Name = this.SaveData.GetData("Name"); }
catch { this.LoadFailedMessage("Name"); }
try { this.ID = this.SaveData.GetData("ID"); }
catch { this.LoadFailedMessage("ID"); }
try { this.Description = this.SaveData.GetData("Description"); }
catch { this.LoadFailedMessage("Description"); }
}
public void LoadFailedMessage(String property)