- Added new Project. Mud Designer project will include the GUI elements needed for graphically building a MUD. Due to Environment creation being finalized, work on a GUI based Environment creation can start. Mud Engine: - Objects no longer require a path to be supplied when calling Object.Save() - EditRealm command now edits senses. - EditRoom now fully supports creating doorways, however editing existing doorways and linking to existing rooms is not implemented. This command only supports creating new doorways for non-existing Rooms (Rooms are generated as needed) - EditZone Now fully supports senses and implemented. - Game now supports loading of .ini files when calling Game.Load() - All objects now include a SavePath properties. Override this to supply a path for where the object needs to be saved. All Environment and BaseCharacter objects override the BaseObject.SavePath to save into ActiveGame.DataPaths.Environemnts and Players respectively. - ObjectCollection now instanced during ScriptEngine initialization to prevent exceptions during runtime. - Create command no longer converts all names to lower case. - Updated the Walk command to execute the Look command in a safe manor without injecting a command into the player Telnet console.
42 lines
No EOL
1.5 KiB
C#
42 lines
No EOL
1.5 KiB
C#
/// <summary>
|
|
/// The Save command will save the current player to a hard-disk file.
|
|
/// </summary>
|
|
public class CommandSave : IGameCommand
|
|
{
|
|
/// <summary>
|
|
/// Used by the Command Engine to allow for overriding any other commands that contain the same name.
|
|
/// TODO: Does Overriding Commands still work? This is part of some old code I wrote several years back and might be broke.
|
|
/// </summary>
|
|
public Boolean Override { get; set; }
|
|
|
|
/// <summary>
|
|
/// The name of the command.
|
|
/// If Override is set to true, this command will override any other command that contains the same name.
|
|
/// </summary>
|
|
public String Name { get; set; }
|
|
|
|
/// <summary>
|
|
/// A collection of strings that contains helpfull information for this Command.
|
|
/// When the user enteres 'Help Exit' the game will print the content of this collection.
|
|
/// This is treated like a virtual book, each entry in the collection is printed as a new line.
|
|
/// </summary>
|
|
public List<String> Help { get; set; }
|
|
|
|
/// <summary>
|
|
/// Constructor for the class.
|
|
/// </summary>
|
|
public CommandSave()
|
|
{
|
|
Help = new List<String>();
|
|
Help.Add("Saves your character immediately.");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Constructor for the class.
|
|
/// </summary>
|
|
public void Execute(String command, BaseCharacter player)
|
|
{
|
|
//Save the player to the hard-disk.
|
|
player.Save();
|
|
}
|
|
} |