MudEngine:
- Added FileManager.GetDataCollection() Method for getting a collection of values that match the supplied parameter. This is used by environments for restoring saved object collections - World Restoration is now fully implemented. - Removed un-needed Log messages - Added a pushMessage parameter to Log.Write() allowing messages to be sent directly to the console instead of stacking them in a cache. All log messages now push the message by default.
This commit is contained in:
parent
742b75eeb6
commit
5aa5504171
12 changed files with 282 additions and 81 deletions
|
@ -170,11 +170,23 @@ namespace MudEngine.GameObjects
|
|||
|
||||
public virtual void Load(String filename)
|
||||
{
|
||||
if (String.IsNullOrEmpty(filename))
|
||||
return;
|
||||
|
||||
if (!File.Exists(filename))
|
||||
{
|
||||
Log.Write("Error: Attempted to load file " + filename);
|
||||
return;
|
||||
}
|
||||
this.Name = FileManager.GetData(filename, "Name");
|
||||
this.Description = FileManager.GetData(filename, "Description");
|
||||
this.Feel = FileManager.GetData(filename, "Feel");
|
||||
this.Listen = FileManager.GetData(filename, "Listen");
|
||||
this.Smell = FileManager.GetData(filename, "Smell");
|
||||
|
||||
//Set the Filename property based off the physical filename, as setting this.Name sets a default filename
|
||||
//which might not match that of the actual physical filename on the harddrive.
|
||||
this.Filename = Path.GetFileName(filename);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue