MudCompiler:
- Removed External Script compilation support for now. I'll add it back once I provide SourceFile and SourceCode compiling support to the MudScriptCompiler. At the moment only Whole Directory compiling is supported. MudDesigner: - Removed all of the source code, with the exception of the designer generated source, from frmProjectManager. It will need to be re-wrote due to the removal of the MudScriptEngine. MudEngine: - Deleted Scripting.GameObject - Deleted Scripting.GameObjectCollection - Deleted Scripting.ScriptEngine - Deleted classes were replaced by the rScript engine. Only class needed now is the MudScriptCompiler, which handles all of the custom MudEngine script compiling, using the rScript Engine. - Removed old Scripting.ScriptEngine references from within GameManagement.Game - GameManagement.Game no longer checks to see if MudEngine.dll exists. If it didn't exist, the engine wouldn't be running to perform that check in the first place. - GameManagement.Game no longer adds MudEngine.dll as a referenced assembly. The MudScriptCompiler handles that during compilation. - MudScriptCompiler.Compile() always returns false when SourceFile or SourceCode is passed as an argument. Only Script Directories can be compiled at this time. MudGame: - Removed references to Scripting.ScriptEngine from MudGame.Program - Re-wrote how scripted Type's that inherit and replace MudEngine.GameManagement.Game. Scripts are compiled prior to Game.Start() being invoked, allowing GameManagement.Game to be replaced with an inherited class from a compiled script. TODO: Look at a way to prevent Game.Start() from compiling the scripts again, as they have already been compiled once. It's not a big hit on startup time, but it needs to be wrote the proper way.
This commit is contained in:
parent
7a0d1c5a74
commit
3f73247d0e
10 changed files with 38 additions and 689 deletions
|
@ -52,13 +52,7 @@ namespace MudEngine.GameManagement
|
|||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public SaveDataPaths DataPaths { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the scripting engine used by the game.
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public ScriptEngine scriptEngine { get; internal set; }
|
||||
|
||||
|
||||
[Browsable(false)]
|
||||
public rScripting.CompileEngine Scripting { get; internal set; }
|
||||
|
||||
|
@ -201,7 +195,6 @@ namespace MudEngine.GameManagement
|
|||
{
|
||||
//Instance all of the Games Objects.
|
||||
CurrencyList = new List<Currency>();
|
||||
scriptEngine = new Scripting.ScriptEngine(this); //TODO - Remove
|
||||
Scripting = new rScripting.CompileEngine(".cs");
|
||||
World = new GameWorld(this);
|
||||
WorldTime = new GameTime(this);
|
||||
|
@ -246,17 +239,9 @@ namespace MudEngine.GameManagement
|
|||
if (!Directory.Exists(DataPaths.Players))
|
||||
Directory.CreateDirectory(DataPaths.Players);
|
||||
|
||||
//Load both pre-compiled and file based scripts - TODO - Remove
|
||||
//scriptEngine.ScriptType = ScriptEngine.ScriptTypes.Both;
|
||||
//scriptEngine.Initialize();
|
||||
|
||||
//Instance the new scripting engine
|
||||
Scripting.Compiler = "MudScriptCompiler";
|
||||
if (!System.IO.File.Exists("MudEngine.dll"))
|
||||
Log.Write("CRITICAL ERROR: Un-able to locate MudEngine.dll");
|
||||
|
||||
Scripting.AddAssemblyReference("MudEngine.dll");
|
||||
|
||||
//Check for compiler errors after script compiling completes.
|
||||
if (!Scripting.Compile(DataPaths.Scripts))
|
||||
{
|
||||
Log.Write("CRITICAL ERROR: Game Script Repository failed to compile!");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue