MudEngine:
- Game World Auto-save property now fully implemented. However, the Game world saving mechanics are not fully implemented. As additional components are implemented, they will be auto-saved if the property is set to true. - Game.AutoSaveInterval property added for setting how often the Game will save all objects in the world (incase run-time changes to environments/objects were made, they must be saved). - Player walk command now supports Game.AutoSave. Every-time the player changes location they will be saved. - ScriptEngine now supports Initializing both Assembly and Source based scripts at the same time via the new ScriptTypes.Both element. - ScriptEngine now auto-loads previously saved settings from Settings.ini - Game.ObjectIdentifierCollection renamed to Game.WorldObjects. Type collection changed from that of Int32 to BaseObject. - Game.update now contains the code needed to update the World Time and Auto-Save the world if needed. - Game.AddObject method added for adding World Objects to the Game.WorldObjects collection
This commit is contained in:
parent
d212f5b854
commit
7a4c9211d4
9 changed files with 105 additions and 61 deletions
|
@ -21,7 +21,7 @@ namespace MudEngine.GameObjects
|
|||
[RefreshProperties(RefreshProperties.All)]
|
||||
public string Name { get; set; }
|
||||
|
||||
public Guid ID { get; internal set; }
|
||||
public Int32 ID { get; internal set; }
|
||||
|
||||
[Category("Object Setup")]
|
||||
[Description("A brief description of this object. The description is displayed to users when they use a command for investigating an object")]
|
||||
|
@ -39,10 +39,8 @@ namespace MudEngine.GameObjects
|
|||
{
|
||||
//Returns the name of the object + the objects Type as it's extension.
|
||||
//Filenames are generated by the class itself, users can not assign it.
|
||||
get
|
||||
{
|
||||
return this.ID + "." + GetType().Name;
|
||||
}
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[Category("Environment Information")]
|
||||
|
@ -76,12 +74,22 @@ namespace MudEngine.GameObjects
|
|||
this.Smell = "You don't smell anything unsual.";
|
||||
this.Name = DefaultName();
|
||||
|
||||
this.Filename = DefaultName() + "." + this.GetType().Name;
|
||||
|
||||
//This must be called on instancing of the object.
|
||||
//It is unique and will be used for saving the object.
|
||||
//Allows for multiple objects with the same Name property
|
||||
//but different Identifiers. Letting there be multiple versions
|
||||
//of the same object.
|
||||
this.ID = Guid.NewGuid();
|
||||
|
||||
ActiveGame.AddObject(this);
|
||||
}
|
||||
|
||||
|
||||
~BaseObject()
|
||||
{
|
||||
//We must free up this ID so that it can be used by other objects being instanced.
|
||||
ActiveGame.RemoveObject(this);
|
||||
}
|
||||
|
||||
private bool ShouldSerializeName()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue