XMLData class added. This will manage the saving and loading of all scripted objects during runtime. The saved files will be XML formatted.

Added rScript files to the engine.  These have not been implemented and currently don't work with the engine.
BaseScript has been modified to support the new XMLData class for saving data.
This commit is contained in:
Scionwest_cp 2012-02-29 20:06:14 -08:00
parent fc27d9fc22
commit 38bdf75bf1
16 changed files with 1174 additions and 25 deletions

View file

@ -6,6 +6,7 @@ using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Xml.Linq;
using MudEngine.GameScripts;
using MudEngine.Core.Interfaces;
@ -47,18 +48,18 @@ namespace MudEngine.Game.Characters
protected CommandSystem Commands { get; private set; }
public StandardCharacter(String name, String description, StandardGame game) : base(name, description)
public StandardCharacter(StandardGame game, String name, String description) : base(game, name, description)
{
this.Game = game;
//Instance this Characters personal Command System with a copy of the command
//collection already loaded and prepared by the Active Game.
this.Commands = new CommandSystem(CommandSystem.Commands);
this.OnConnectEvent += new OnConnectHandler(OnConnect);
}
public StandardCharacter(String name, String description, StandardGame game, Socket connection) : this(name, description, game)
public StandardCharacter(StandardGame game, String name, String description, Socket connection) : this(game, name, description)
{
this._Connection = connection;
@ -69,6 +70,18 @@ namespace MudEngine.Game.Characters
this._InitialMessage = true; //Strips Telnet client garbage text from initial message sent from client.
}
public override bool Save(String filename)
{
base.Save(filename, true);
SaveData.AddSaveData("Immovable", Immovable.ToString());
SaveData.AddSaveData("Password", Password);
this.SaveData.Save(filename);
return true;
}
internal void ExecuteCommand(string command)
{
//Process commands here.
@ -176,11 +189,6 @@ namespace MudEngine.Game.Characters
}
}
public void Save(string path)
{
throw new NotImplementedException();
}
public void Load(string filename)
{
throw new NotImplementedException();