MudEngine:
- All Objects now dynamically create their Filenames after the BaseObject.Name has been set. You can re-specify a custom filename, but do so after setting BaseObject.Name's value. - Added GameWorld.cs. This will manage the game world itself. - Moved Realm Initialization from Game.Start() into GameWorld.Start() - Moved Environment saving from Game.Save() to GameWorld.Save(). However, GameWorld.Save gets invoked from Game.Save() - GameWorld is now responsible for adding Realms to the Game. - Fixed ScriptEngine not using Both Scripts and Assemblies at the same time. - Added BaseAI which inherits from baseCharacter. All AI objects will inherit from this object. MudGame: - Modified MyGame.cs script for demonstrating the new way to create environments with the implementation of GameWorld. - Updated Program.cs to compile both Scripts and Assemblies at once.
This commit is contained in:
parent
7a4c9211d4
commit
717034f9ed
9 changed files with 259 additions and 153 deletions
|
@ -19,7 +19,22 @@ namespace MudEngine.GameObjects
|
|||
[Description("The Display Name assigned to this object.")]
|
||||
//Required to refresh Filename property in the editors propertygrid
|
||||
[RefreshProperties(RefreshProperties.All)]
|
||||
public string Name { get; set; }
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return _Name;
|
||||
}
|
||||
set
|
||||
{
|
||||
_Name = value;
|
||||
if (this.GetType().Name.StartsWith("Base"))
|
||||
Filename = value + "." + this.GetType().Name.Substring("Base".Length);
|
||||
else
|
||||
Filename = value + "." + this.GetType().Name;
|
||||
}
|
||||
}
|
||||
private string _Name;
|
||||
|
||||
public Int32 ID { get; internal set; }
|
||||
|
||||
|
@ -82,14 +97,14 @@ namespace MudEngine.GameObjects
|
|||
//but different Identifiers. Letting there be multiple versions
|
||||
//of the same object.
|
||||
|
||||
ActiveGame.AddObject(this);
|
||||
//ActiveGame.World.AddObject(this);
|
||||
}
|
||||
|
||||
|
||||
~BaseObject()
|
||||
{
|
||||
//We must free up this ID so that it can be used by other objects being instanced.
|
||||
ActiveGame.RemoveObject(this);
|
||||
//ActiveGame.World.RemoveObject(this);
|
||||
}
|
||||
|
||||
private bool ShouldSerializeName()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue