This commit is contained in:
Budoray_cp 2011-09-18 12:51:20 -07:00
parent b0cfc5f487
commit cd68f3d042
14 changed files with 18 additions and 285 deletions

View file

@ -141,6 +141,7 @@ namespace MudEngine.Scripting
//TODO: Add single-file compilation support //TODO: Add single-file compilation support
return false; //Single file compiling not implemented. TODO! return false; //Single file compiling not implemented. TODO!
/**** Unreachable Code at the moment
//Make sure we have a compiler version supplied. //Make sure we have a compiler version supplied.
if (!CompilerOptions.ContainsKey("CompilerVersion")) if (!CompilerOptions.ContainsKey("CompilerVersion"))
CompilerOptions.Add("CompilerVersion", "v4.0"); CompilerOptions.Add("CompilerVersion", "v4.0");
@ -163,6 +164,7 @@ namespace MudEngine.Scripting
return false; return false;
else else
return true; return true;
***/
} }
/// <summary> /// <summary>
@ -176,6 +178,7 @@ namespace MudEngine.Scripting
//Source Code compiling not implemented. //Source Code compiling not implemented.
return false; //TODO: Add source code compiling support. return false; //TODO: Add source code compiling support.
/**** Unreachable code at the moment
if (!CompilerOptions.ContainsKey("CompilerVersion")) if (!CompilerOptions.ContainsKey("CompilerVersion"))
CompilerOptions.Add("CompilerVersion", "v4.0"); CompilerOptions.Add("CompilerVersion", "v4.0");
@ -195,6 +198,7 @@ namespace MudEngine.Scripting
return false; return false;
else else
return true; return true;
****/
} }
} }
} }

View file

@ -4,38 +4,13 @@
/// Newly created content will be available for players to use/traverse immediately after creation is completed. /// Newly created content will be available for players to use/traverse immediately after creation is completed.
/// Rooms that are created may be linked together using the LinkRoom command. /// Rooms that are created may be linked together using the LinkRoom command.
/// </summary> /// </summary>
public class CommandCreate : IGameCommand public class CommandCreate : BaseCommand
{ {
/// <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; }
//Private fields that are used during the creation of the environments.
private Realm realm;
private Zone zone;
private Room room;
/// <summary> /// <summary>
/// Constructor for the class. /// Constructor for the class.
/// </summary> /// </summary>
public CommandCreate() public CommandCreate()
{ {
Help = new List<String>();
Help.Add("Provides Admins the ability to create content dynamically within the game world."); Help.Add("Provides Admins the ability to create content dynamically within the game world.");
Help.Add("Content is created at run-time while the server/game is running and players are connected."); Help.Add("Content is created at run-time while the server/game is running and players are connected.");
Help.Add("Newly created content will be available for players to use/traverse immediately after creation is completed."); Help.Add("Newly created content will be available for players to use/traverse immediately after creation is completed.");

View file

@ -1,36 +1,15 @@
 /// <summary>
/// <summary>
/// This command creates a Room within the players current Realm>Zone. /// This command creates a Room within the players current Realm>Zone.
/// Admins using this command will not need to supply a fully qualified path like the 'Create' command requires. /// Admins using this command will not need to supply a fully qualified path like the 'Create' command requires.
/// However, they are restricted to creating Rooms only within their current Realm>Zone. /// However, they are restricted to creating Rooms only within their current Realm>Zone.
/// </summary> /// </summary>
class CommandCreateRoom : IGameCommand public class CommandCreateRoom : BaseCommand
{ {
/// <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> /// <summary>
/// Constructor for the class. /// Constructor for the class.
/// </summary> /// </summary>
public CommandCreateRoom() public CommandCreateRoom()
{ {
Help = new List<String>();
Help.Add("Creates a Room within the Admin's current Realm>Zone"); Help.Add("Creates a Room within the Admin's current Realm>Zone");
} }

View file

@ -4,34 +4,13 @@
/// This command is used to link Rooms dynamically during run-time by Admins, allowing environments to be created /// This command is used to link Rooms dynamically during run-time by Admins, allowing environments to be created
/// and traversed on-the-fly without the need to modify scripts and re-start the server. /// and traversed on-the-fly without the need to modify scripts and re-start the server.
/// </summary> /// </summary>
public class CommandLinkRoom : IGameCommand public class CommandLinkRoom : BaseCommand
{ {
/// <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> /// <summary>
/// Constructor for the class. /// Constructor for the class.
/// </summary> /// </summary>
public CommandLinkRoom() public CommandLinkRoom()
{ {
//Instance the help collection and add our help information to it.
Help = new List<String>();
Help.Add("Use this to link two previously created Rooms together."); Help.Add("Use this to link two previously created Rooms together.");
//Incase Admins try to use the command, they will know that it's broken. //Incase Admins try to use the command, they will know that it's broken.
//Don't convert this class into a Script until it is fully completed. //Don't convert this class into a Script until it is fully completed.

View file

@ -1,30 +1,10 @@
/// <summary> /// <summary>
/// The List command is used to list filenames of a specified object type. /// The List command is used to list filenames of a specified object type.
/// </summary> /// </summary>
public class CommandList : IGameCommand public class CommandList : BaseCommand
{ {
/// <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; }
public CommandList() public CommandList()
{ {
Help = new List<String>();
Help.Add("Using the List command, you can view a generated list of filenames that pertain to a supplied object type."); Help.Add("Using the List command, you can view a generated list of filenames that pertain to a supplied object type.");
Help.Add("Usage: List 'ItemType'"); Help.Add("Usage: List 'ItemType'");
Help.Add("Usage: List 'ItemName>ItemType'"); Help.Add("Usage: List 'ItemName>ItemType'");

View file

@ -1,30 +1,10 @@
/// <summary> /// <summary>
/// The List command is used to list filenames of a specified object type. /// The List command is used to list filenames of a specified object type.
/// </summary> /// </summary>
public class CommandTeleport : IGameCommand public class CommandTeleport : BaseCommand
{ {
/// <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; }
public CommandTeleport() public CommandTeleport()
{ {
Help = new List<String>();
Help.Add("The Teleport command will teleport a player to a specified Room, regardless of where they are at."); Help.Add("The Teleport command will teleport a player to a specified Room, regardless of where they are at.");
Help.Add("Usage: Teleport playername FullyQualifiedRoomPath"); Help.Add("Usage: Teleport playername FullyQualifiedRoomPath");
Help.Add("Example: Teleport Billy MyRealm>MyZone>MyRoom"); Help.Add("Example: Teleport Billy MyRealm>MyZone>MyRoom");

View file

@ -1,33 +1,13 @@
/// <summary> /// <summary>
/// The Clear command is used to clear the players terminal screen of all text. /// The Clear command is used to clear the players terminal screen of all text.
/// </summary> /// </summary>
public class CommandClear : IGameCommand public class CommandClear : BaseCommand
{ {
/// <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> /// <summary>
/// Constructor for the class. /// Constructor for the class.
/// </summary> /// </summary>
public CommandClear() public CommandClear()
{ {
Help = new List<String>();
Help.Add("The Clear command is used to clear the screen of all text."); Help.Add("The Clear command is used to clear the screen of all text.");
} }

View file

@ -3,36 +3,13 @@
/// Using this command while connected to a MUD server will perform a disconnect from the server. /// Using this command while connected to a MUD server will perform a disconnect from the server.
/// Using the command while running the game in offline mode will simply shut down the game. /// Using the command while running the game in offline mode will simply shut down the game.
/// </summary> /// </summary>
public class CommandExit : IGameCommand public class CommandExit : BaseCommand
{ {
/// <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> /// <summary>
/// Constructor for the class. /// Constructor for the class.
/// </summary> /// </summary>
public CommandExit() public CommandExit()
{ {
//Instance the help collection and add our help information to it.
//Typically the Help content is placed within the constructor, but this particular help document
//needs to access information from the player, so we will build our Help collection in the Execute command.
Help = new List<String>();
Help.Add("Exits the game."); Help.Add("Exits the game.");
} }

View file

@ -2,34 +2,13 @@
/// The GetTime command is used to print the current in-game time to the player. /// The GetTime command is used to print the current in-game time to the player.
/// This command will print the day, month and year along with hour, minute and seconds. /// This command will print the day, month and year along with hour, minute and seconds.
/// </summary> /// </summary>
public class CommandGetTime : IGameCommand public class CommandGetTime : BaseCommand
{ {
/// <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> /// <summary>
/// Constructor for the class. /// Constructor for the class.
/// </summary> /// </summary>
public CommandGetTime() public CommandGetTime()
{ {
//Instance the help collection and add our help information to it.
Help = new List<String>();
Help.Add("Gives you the current time and date in the game world."); Help.Add("Gives you the current time and date in the game world.");
} }

View file

@ -1,33 +1,13 @@
/// <summary> /// <summary>
/// Help command provides information on all the existing game commands, including script based commands. /// Help command provides information on all the existing game commands, including script based commands.
/// </summary> /// </summary>
public class CommandHelp : IGameCommand public class CommandHelp : BaseCommand
{ {
/// <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> /// <summary>
/// Constructor for the class. /// Constructor for the class.
/// </summary> /// </summary>
public CommandHelp() public CommandHelp()
{ {
Help = new List<String>();
Help.Add("Provides help on various topics."); Help.Add("Provides help on various topics.");
Help.Add("You may ask for help on any game command."); Help.Add("You may ask for help on any game command.");
Help.Add("Usage: Help"); Help.Add("Usage: Help");

View file

@ -4,33 +4,13 @@
/// If the Room.DetailedDescription collection property contains content, it will be printed to the screen /// If the Room.DetailedDescription collection property contains content, it will be printed to the screen
/// after the Room.Description property is printed (provided Room.Description is not empty.) /// after the Room.Description property is printed (provided Room.Description is not empty.)
/// </summary> /// </summary>
public class CommandLook : IGameCommand public class CommandLook : BaseCommand
{ {
/// <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> /// <summary>
/// Constructor for the class. /// Constructor for the class.
/// </summary> /// </summary>
public CommandLook() public CommandLook()
{ {
Help = new List<String>();
Help.Add("Prints a description of the current Room and the objects that reside within it."); Help.Add("Prints a description of the current Room and the objects that reside within it.");
} }

View file

@ -1,33 +1,13 @@
/// <summary> /// <summary>
/// The Save command will save the current player to a hard-disk file. /// The Save command will save the current player to a hard-disk file.
/// </summary> /// </summary>
public class CommandSave : IGameCommand public class CommandSave : BaseCommand
{ {
/// <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> /// <summary>
/// Constructor for the class. /// Constructor for the class.
/// </summary> /// </summary>
public CommandSave() public CommandSave()
{ {
Help = new List<String>();
Help.Add("Saves your character immediately."); Help.Add("Saves your character immediately.");
} }

View file

@ -2,33 +2,13 @@
/// The Say command provides the player with the ability to chat with other players within the game world. /// The Say command provides the player with the ability to chat with other players within the game world.
/// Players using the Say command can only talk to players that are currently within the same Room. /// Players using the Say command can only talk to players that are currently within the same Room.
/// </summary> /// </summary>
public class CommandSay : IGameCommand public class CommandSay : BaseCommand
{ {
/// <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> /// <summary>
/// Constructor for the class. /// Constructor for the class.
/// </summary> /// </summary>
public CommandSay() public CommandSay()
{ {
Help = new List<String>();
Help.Add("Allows you to Chat with with players around you."); Help.Add("Allows you to Chat with with players around you.");
Help.Add("Note that you can only chat with players that reside within the same Room as yourself."); Help.Add("Note that you can only chat with players that reside within the same Room as yourself.");
Help.Add("Usage: Say Hello everyone!"); Help.Add("Usage: Say Hello everyone!");

View file

@ -3,33 +3,13 @@
/// The command supports all of the available travel directions found within the /// The command supports all of the available travel directions found within the
/// MudEngine.GameObjects.Environment.AvailableTravelDirections enum. /// MudEngine.GameObjects.Environment.AvailableTravelDirections enum.
/// </summary> /// </summary>
public class CommandWalk : IGameCommand public class CommandWalk : BaseCommand
{ {
/// <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> /// <summary>
/// Constructor for the class. /// Constructor for the class.
/// </summary> /// </summary>
public CommandWalk() public CommandWalk()
{ {
Help = new List<String>();
Help.Add("Allows you to traverse through the world."); Help.Add("Allows you to traverse through the world.");
Help.Add("You may walk in any direction available within the current Room."); Help.Add("You may walk in any direction available within the current Room.");
Help.Add("You may use the Look command to see a description of the current Room, and decide where you would like to walk."); Help.Add("You may use the Look command to see a description of the current Room, and decide where you would like to walk.");