Engine:
- Removed the ManagedScripting Engine from the project. Scripting will be implemented at a later time using a custom build engine. - Room.Load was re-wrote to allow for loading a supplied room name (not a full filename). The Room will load the supplied Roomname by checking within it's current Zone. Rooms within different Zones can be loaded by supplying a Zone name as one of the optional parameters. Same goes for loading Rooms within a different Realm - All classes using the original Room.Load code have been tweaked to use the new code. Cuts the needed code used by each individual class by 80%. - Room.InstallPath Property added for returning the full filename and location of the Room where it's currently installed. Designer: - Room Designer now supports deleting Rooms. - Doorway Editor no longer fails when attempting to change doorway Traveling Directions. Runtime: - No longer prints blank lines if the object does not contain any text to print. - Added a 2nd Print method with a boolean argument for printing blank lines by force if needed. Note: Room Deleting and Room.Load code was only tested using Rooms within Root Zones. Rooms contained within a Zone owned by a Realm was not tested.
This commit is contained in:
parent
59502408ce
commit
f79a5d482b
15 changed files with 147 additions and 92 deletions
|
@ -100,7 +100,6 @@ namespace MudDesigner.MudEngine.GameObjects
|
|||
private string _Name = "";
|
||||
#endregion
|
||||
|
||||
#region Constructor & Private Methods
|
||||
/// <summary>
|
||||
/// Initializes the base object
|
||||
/// </summary>
|
||||
|
@ -114,7 +113,6 @@ namespace MudDesigner.MudEngine.GameObjects
|
|||
this.Listen = "You hear nothing of interest.";
|
||||
this.Smell = "You don't smell anything unsual.";
|
||||
this.Name = DefaultName();
|
||||
SetupScript();
|
||||
}
|
||||
|
||||
private bool ShouldSerializeName()
|
||||
|
@ -132,39 +130,13 @@ namespace MudDesigner.MudEngine.GameObjects
|
|||
return "New " + this.GetType().Name;
|
||||
}
|
||||
|
||||
private void SetupScript()
|
||||
{
|
||||
//Check if the realm script is empty. If so then generate a standard script for it.
|
||||
if (Script == "")
|
||||
{
|
||||
//Instance a new method helper class
|
||||
ManagedScripting.CodeBuilding.MethodSetup method = new ManagedScripting.CodeBuilding.MethodSetup();
|
||||
string script = "";
|
||||
//Setup our method. All objects inheriting from BaseObject will have the standard
|
||||
//methods created for them.
|
||||
string[] names = new string[] { "OnCreate", "OnDestroy", "OnEnter", "OnExit" };
|
||||
foreach (string name in names)
|
||||
{
|
||||
method = new ManagedScripting.CodeBuilding.MethodSetup();
|
||||
method.Name = name;
|
||||
method.ReturnType = "void";
|
||||
method.IsOverride = true;
|
||||
method.Modifier = ManagedScripting.CodeBuilding.ClassGenerator.Modifiers.Public;
|
||||
method.Code = new string[] { "base." + method.Name + "();" };
|
||||
script = script.Insert(Script.Length, method.Create() + "\n");
|
||||
}
|
||||
Script = script;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
/// <summary>
|
||||
/// Loads the supplied filename and returns it.
|
||||
/// </summary>
|
||||
/// <param name="filename"></param>
|
||||
/// <returns></returns>
|
||||
public object Load(string filename)
|
||||
public virtual object Load(string filename)
|
||||
{
|
||||
if (!File.Exists(filename))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue