- Renamed FileSystem.FileSystem.cs to FileSystem.FileManager.cs
- Moved ValidateDataPaths() from Engine.cs to FileManager.cs - Moved GetDataPath() from Engine.cs to FileManager.cs - Moved SaveDataTypes out from Engine.cs into it's own file. MudEngine.FileSystem.SaveDataTypes.cs - Moved _CurrentRoom, _CurrentZone, _CurrentRealm and _ScriptEngine out from all editors containing those Fields, and placed them as static properties within Program.cs Room, Zone, Realm and ScriptEngine Properties - Created 3 new Interfaces. IGameObject, IQuest and IRuleSet. - Created QuestSetup class to begin working on Quest Editor at some point.
This commit is contained in:
parent
c1d60639f5
commit
379c6f844d
17 changed files with 327 additions and 239 deletions
|
@ -25,7 +25,7 @@ namespace MudDesigner.Editors
|
|||
InitializeComponent();
|
||||
_Currency = new Currency();
|
||||
propertyGrid1.SelectedObject = _Currency;
|
||||
foreach (string currency in System.IO.Directory.GetFiles(Engine.GetDataPath(Engine.SaveDataTypes.Currency), "*.xml"))
|
||||
foreach (string currency in System.IO.Directory.GetFiles(FileManager.GetDataPath(SaveDataTypes.Currency), "*.xml"))
|
||||
{
|
||||
lstCurrencies.Items.Add(System.IO.Path.GetFileNameWithoutExtension(currency));
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ namespace MudDesigner.Editors
|
|||
return;
|
||||
}
|
||||
|
||||
FileSystem.Save(Application.StartupPath + @"\Data\Currency\" + _Currency.Name + ".xml", _Currency);
|
||||
FileManager.Save(Application.StartupPath + @"\Data\Currency\" + _Currency.Name + ".xml", _Currency);
|
||||
lstCurrencies.Items.Add(_Currency.Name);
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ namespace MudDesigner.Editors
|
|||
if (lstCurrencies.SelectedIndex == -1)
|
||||
return;
|
||||
|
||||
_Currency = (Currency)FileSystem.Load(Application.StartupPath + @"\Data\Currency\" + lstCurrencies.SelectedItem.ToString() + ".xml", _Currency);
|
||||
_Currency = (Currency)FileManager.Load(Application.StartupPath + @"\Data\Currency\" + lstCurrencies.SelectedItem.ToString() + ".xml", _Currency);
|
||||
propertyGrid1.SelectedObject = _Currency;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace MudDesigner.Editors
|
|||
private void frmMain_Load(object sender, EventArgs e)
|
||||
{
|
||||
//Get all of the realms currently created.
|
||||
string[] files = System.IO.Directory.GetFiles(Engine.GetDataPath(Engine.SaveDataTypes.Realms), "*.realm");
|
||||
string[] files = System.IO.Directory.GetFiles(FileManager.GetDataPath(SaveDataTypes.Realms), "*.realm");
|
||||
|
||||
//Aquire the Project settings and show them.
|
||||
propertyGrid1.SelectedObject = Program.Project;
|
||||
|
@ -44,7 +44,7 @@ namespace MudDesigner.Editors
|
|||
//Instance a new realm
|
||||
Realm newRealm = new Realm();
|
||||
//De-serialize the current realm.
|
||||
newRealm = (Realm)FileSystem.Load(realm, newRealm);
|
||||
newRealm = (Realm)FileManager.Load(realm, newRealm);
|
||||
//Add it to the available realms combo box.
|
||||
comRealms.Items.Add(newRealm.Name);
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ namespace MudDesigner.Editors
|
|||
{
|
||||
Zone newZone = new Zone();
|
||||
//De-serialize the current zone.
|
||||
newZone = (Zone)FileSystem.Load(zone, newZone);
|
||||
newZone = (Zone)FileManager.Load(zone, newZone);
|
||||
//Add it to the available zones list box
|
||||
lstZones.Items.Add(newZone.Name);
|
||||
zones.Add(newZone);
|
||||
|
@ -118,7 +118,7 @@ namespace MudDesigner.Editors
|
|||
{
|
||||
Room newRoom = new Room();
|
||||
//De-serialize the current Room.
|
||||
newRoom = (Room)FileSystem.Load(room, newRoom);
|
||||
newRoom = (Room)FileManager.Load(room, newRoom);
|
||||
//Add it to the available rooms list box
|
||||
lstRooms.Items.Add(newRoom.Name);
|
||||
rooms.Add(newRoom);
|
||||
|
@ -148,8 +148,8 @@ namespace MudDesigner.Editors
|
|||
|
||||
private void ProjectSettings_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
string filename = System.IO.Path.Combine(Engine.GetDataPath(Engine.SaveDataTypes.Root), "Project.xml");
|
||||
FileSystem.Save(filename, Program.Project);
|
||||
string filename = System.IO.Path.Combine(FileManager.GetDataPath(SaveDataTypes.Root), "Project.xml");
|
||||
FileManager.Save(filename, Program.Project);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,42 +19,39 @@ namespace MudDesigner.Editors
|
|||
{
|
||||
public partial class RealmExplorer : Form
|
||||
{
|
||||
Zone _Zone;
|
||||
Realm _CurrentRealm;
|
||||
List<Zone> _AvailableZones;
|
||||
ScriptingEngine _ScriptEngine;
|
||||
|
||||
public RealmExplorer()
|
||||
{
|
||||
InitializeComponent();
|
||||
_Zone = new Zone();
|
||||
_CurrentRealm = new Realm();
|
||||
Program.Zone = new Zone();
|
||||
Program.Realm = new Realm();
|
||||
_AvailableZones = new List<Zone>();
|
||||
_ScriptEngine = new ScriptingEngine();
|
||||
_ScriptEngine.CompileStyle = ManagedScripting.Compilers.BaseCompiler.ScriptCompileStyle.CompileToMemory;
|
||||
_ScriptEngine.KeepTempFiles = false;
|
||||
Program.ScriptEngine = new ScriptingEngine();
|
||||
Program.ScriptEngine.CompileStyle = ManagedScripting.Compilers.BaseCompiler.ScriptCompileStyle.CompileToMemory;
|
||||
Program.ScriptEngine.KeepTempFiles = false;
|
||||
|
||||
BuildZoneLists();
|
||||
|
||||
SetupScript();
|
||||
|
||||
propertyRealm.SelectedObject = _CurrentRealm;
|
||||
propertyRealm.SelectedObject = Program.Realm;
|
||||
|
||||
string[] existingRealms = System.IO.Directory.GetFiles(Engine.GetDataPath(Engine.SaveDataTypes.Realms));
|
||||
string[] existingRealms = System.IO.Directory.GetFiles(FileManager.GetDataPath(SaveDataTypes.Realms));
|
||||
foreach (string realm in existingRealms)
|
||||
lstRealms.Items.Add(System.IO.Path.GetFileNameWithoutExtension(realm));
|
||||
}
|
||||
|
||||
private void BuildZoneLists()
|
||||
{
|
||||
string[] zones = System.IO.Directory.GetFiles(Engine.GetDataPath(Engine.SaveDataTypes.Zones), "*.zone");
|
||||
string[] zones = System.IO.Directory.GetFiles(FileManager.GetDataPath(SaveDataTypes.Zones), "*.zone");
|
||||
bool available = true;
|
||||
lstAvailableZones.Items.Clear();
|
||||
lstZonesInRealm.Items.Clear();
|
||||
|
||||
foreach (string zone in zones)
|
||||
{
|
||||
string[] realms = System.IO.Directory.GetFiles(Engine.GetDataPath(Engine.SaveDataTypes.Realms), "*.realm");
|
||||
string[] realms = System.IO.Directory.GetFiles(FileManager.GetDataPath(SaveDataTypes.Realms), "*.realm");
|
||||
|
||||
foreach (string realm in realms)
|
||||
{
|
||||
|
@ -85,7 +82,7 @@ namespace MudDesigner.Editors
|
|||
private void SetupScript()
|
||||
{
|
||||
//Check if the realm script is empty. If so then generate a standard script for it.
|
||||
if (String.IsNullOrEmpty(_CurrentRealm.Script))
|
||||
if (String.IsNullOrEmpty(Program.Realm.Script))
|
||||
{
|
||||
//Instance a new method helper class
|
||||
ManagedScripting.CodeBuilding.MethodSetup method = new ManagedScripting.CodeBuilding.MethodSetup();
|
||||
|
@ -101,26 +98,26 @@ namespace MudDesigner.Editors
|
|||
method.IsOverride = true;
|
||||
method.Modifier = ManagedScripting.CodeBuilding.ClassGenerator.Modifiers.Public;
|
||||
method.Code = new string[] { "base." + method.Name + "();" };
|
||||
script = script.Insert(_CurrentRealm.Script.Length, method.Create() + "\n");
|
||||
script = script.Insert(Program.Realm.Script.Length, method.Create() + "\n");
|
||||
}
|
||||
_CurrentRealm.Script = script;
|
||||
Program.Realm.Script = script;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnNewRealm_Click(object sender, EventArgs e)
|
||||
{
|
||||
_Zone = new Zone();
|
||||
_CurrentRealm = new Realm();
|
||||
Program.Zone = new Zone();
|
||||
Program.Realm = new Realm();
|
||||
SetupScript();
|
||||
|
||||
propertyRealm.SelectedObject = _CurrentRealm;
|
||||
propertyRealm.SelectedObject = Program.Realm;
|
||||
lstZonesInRealm.Items.Clear();
|
||||
}
|
||||
|
||||
private void btnSaveRealm_Click(object sender, EventArgs e)
|
||||
{
|
||||
string path = Engine.GetDataPath(Engine.SaveDataTypes.Realms);
|
||||
string filename = System.IO.Path.Combine(path, _CurrentRealm.Name + ".realm");
|
||||
string path = FileManager.GetDataPath(SaveDataTypes.Realms);
|
||||
string filename = System.IO.Path.Combine(path, Program.Realm.Name + ".realm");
|
||||
if (System.IO.File.Exists(filename))
|
||||
{
|
||||
DialogResult result = MessageBox.Show("File exists!\nOverwrite?", "Realm Explorer", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||
|
@ -129,10 +126,10 @@ namespace MudDesigner.Editors
|
|||
return;
|
||||
}
|
||||
|
||||
FileSystem.Save(filename, _CurrentRealm);
|
||||
FileManager.Save(filename, Program.Realm);
|
||||
|
||||
if (!lstRealms.Items.Contains(_CurrentRealm.Name))
|
||||
lstRealms.Items.Add(_CurrentRealm.Name);
|
||||
if (!lstRealms.Items.Contains(Program.Realm.Name))
|
||||
lstRealms.Items.Add(Program.Realm.Name);
|
||||
}
|
||||
|
||||
private void lstRealms_SelectedIndexChanged(object sender, EventArgs e)
|
||||
|
@ -140,19 +137,19 @@ namespace MudDesigner.Editors
|
|||
if (lstRealms.SelectedIndex == -1)
|
||||
return;
|
||||
|
||||
string path = Engine.GetDataPath(Engine.SaveDataTypes.Realms);
|
||||
string path = FileManager.GetDataPath(SaveDataTypes.Realms);
|
||||
string filename = System.IO.Path.Combine(path, lstRealms.SelectedItem.ToString() + ".realm");
|
||||
_CurrentRealm = (Realm)FileSystem.Load(filename, _CurrentRealm);
|
||||
Program.Realm = (Realm)FileManager.Load(filename, Program.Realm);
|
||||
|
||||
propertyRealm.SelectedObject = _CurrentRealm;
|
||||
propertyRealm.SelectedObject = Program.Realm;
|
||||
lstZonesInRealm.Items.Clear();
|
||||
|
||||
foreach (string file in System.IO.Directory.GetFiles(Engine.GetDataPath(Engine.SaveDataTypes.Zones), "*.zone"))
|
||||
foreach (string file in System.IO.Directory.GetFiles(FileManager.GetDataPath(SaveDataTypes.Zones), "*.zone"))
|
||||
{
|
||||
Zone zone = new Zone();
|
||||
zone = (Zone)FileSystem.Load(file, zone);
|
||||
zone = (Zone)FileManager.Load(file, zone);
|
||||
|
||||
if (zone.Realm == _CurrentRealm.Name)
|
||||
if (zone.Realm == Program.Realm.Name)
|
||||
lstZonesInRealm.Items.Add(zone.Name);
|
||||
else if (String.IsNullOrEmpty(zone.Realm))
|
||||
{
|
||||
|
@ -175,7 +172,7 @@ namespace MudDesigner.Editors
|
|||
if (result == DialogResult.No)
|
||||
return;
|
||||
|
||||
string path = Engine.GetDataPath(Engine.SaveDataTypes.Realms);
|
||||
string path = FileManager.GetDataPath(SaveDataTypes.Realms);
|
||||
string filename = System.IO.Path.Combine(path, lstRealms.SelectedItem.ToString() + ".realm");
|
||||
System.IO.File.Delete(filename);
|
||||
lstRealms.Items.Remove(lstRealms.SelectedItem);
|
||||
|
@ -190,22 +187,22 @@ namespace MudDesigner.Editors
|
|||
{
|
||||
if (tabControl1.SelectedTab.Text == "Script")
|
||||
{
|
||||
txtScript.Text = _CurrentRealm.Script;
|
||||
txtScript.Text = Program.Realm.Script;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnValidateScript_Click(object sender, EventArgs e)
|
||||
{
|
||||
_ScriptEngine.Compiler = ManagedScripting.ScriptingEngine.CompilerSelections.SourceCompiler;
|
||||
_ScriptEngine.AddReference(Application.StartupPath + "/MUDEngine.dll");
|
||||
Program.ScriptEngine.Compiler = ManagedScripting.ScriptingEngine.CompilerSelections.SourceCompiler;
|
||||
Program.ScriptEngine.AddReference(Application.StartupPath + "/MUDEngine.dll");
|
||||
string code = "namespace MudDesigner.MudEngine.Objects.Environment\n"
|
||||
+ "{\n"
|
||||
+ " public class " + _CurrentRealm.Name.Replace(" ", "") + " : Realm\n"
|
||||
+ " public class " + Program.Realm.Name.Replace(" ", "") + " : Realm\n"
|
||||
+ " {\n"
|
||||
+ " " + txtScript.Text + "\n"
|
||||
+ " }\n"
|
||||
+ "}\n";
|
||||
MessageBox.Show(_ScriptEngine.Compile(code), "Script Compiling", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
MessageBox.Show(Program.ScriptEngine.Compile(code), "Script Compiling", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
|
||||
private void btnBuildZone_Click(object sender, EventArgs e)
|
||||
|
@ -222,14 +219,14 @@ namespace MudDesigner.Editors
|
|||
return;
|
||||
}
|
||||
|
||||
string path = Engine.GetDataPath(Engine.SaveDataTypes.Zones);
|
||||
string path = FileManager.GetDataPath(SaveDataTypes.Zones);
|
||||
string filename = System.IO.Path.Combine(path, lstAvailableZones.SelectedItem.ToString() + ".zone");
|
||||
Zone zone = new Zone();
|
||||
zone = (Zone)FileSystem.Load(filename, zone);
|
||||
zone.Realm = _CurrentRealm.Name;
|
||||
FileSystem.Save(filename, zone);
|
||||
zone = (Zone)FileManager.Load(filename, zone);
|
||||
zone.Realm = Program.Realm.Name;
|
||||
FileManager.Save(filename, zone);
|
||||
|
||||
_CurrentRealm.Zones.Add(zone);
|
||||
Program.Realm.Zones.Add(zone);
|
||||
lstZonesInRealm.Items.Add(zone.Name);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,15 +18,9 @@ namespace MudDesigner.Editors
|
|||
{
|
||||
public partial class RoomDesigner : Form
|
||||
{
|
||||
//Current _CurrentRoom
|
||||
Room _CurrentRoom;
|
||||
|
||||
//Doorway currently loaded.
|
||||
Door _CurrentDoor;
|
||||
|
||||
//Scripting engine and it's components.
|
||||
ManagedScripting.ScriptingEngine _ScriptEngine;
|
||||
|
||||
//Collection of plugins from within the 'plugins' folder
|
||||
List<System.Reflection.Assembly> _Plugins;
|
||||
|
||||
|
@ -39,7 +33,7 @@ namespace MudDesigner.Editors
|
|||
private void SetupEditor(params object[] parameters)
|
||||
{
|
||||
//Initialize the Room & Doorway
|
||||
_CurrentRoom = new Room();
|
||||
Program.Room = new Room();
|
||||
_CurrentDoor = new Door(AvailableTravelDirections.None);
|
||||
|
||||
//This instances a copy of AvailableTravelDirections which is a list of
|
||||
|
@ -55,10 +49,10 @@ namespace MudDesigner.Editors
|
|||
LoadPlugins();
|
||||
|
||||
//Instance the scripting engine and set it up.
|
||||
_ScriptEngine = new ManagedScripting.ScriptingEngine();
|
||||
_ScriptEngine.Compiler = ManagedScripting.ScriptingEngine.CompilerSelections.SourceCompiler;
|
||||
_ScriptEngine.CompileStyle = ManagedScripting.Compilers.BaseCompiler.ScriptCompileStyle.CompileToMemory;
|
||||
_ScriptEngine.KeepTempFiles = false;
|
||||
Program.ScriptEngine = new ManagedScripting.ScriptingEngine();
|
||||
Program.ScriptEngine.Compiler = ManagedScripting.ScriptingEngine.CompilerSelections.SourceCompiler;
|
||||
Program.ScriptEngine.CompileStyle = ManagedScripting.Compilers.BaseCompiler.ScriptCompileStyle.CompileToMemory;
|
||||
Program.ScriptEngine.KeepTempFiles = false;
|
||||
|
||||
//Get the current rooms scripts.
|
||||
//TODO: Add Doorway script support
|
||||
|
@ -70,14 +64,14 @@ namespace MudDesigner.Editors
|
|||
{
|
||||
if (argument.ToString().ToLower().StartsWith("room="))
|
||||
{
|
||||
string roomPath = Engine.GetDataPath(Engine.SaveDataTypes.Rooms);
|
||||
string roomPath = FileManager.GetDataPath(SaveDataTypes.Rooms);
|
||||
string room = argument.ToString().Substring("room=".Length);
|
||||
string filename = System.IO.Path.Combine(roomPath, room.ToString());
|
||||
|
||||
//Room to load should always be the first arg.
|
||||
if (System.IO.File.Exists(filename))
|
||||
{
|
||||
_CurrentRoom = (Room)FileSystem.Load(filename, _CurrentRoom);
|
||||
Program.Room = (Room)FileManager.Load(filename, Program.Room);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -85,14 +79,14 @@ namespace MudDesigner.Editors
|
|||
|
||||
|
||||
//Show the user(s) the rooms properties
|
||||
propertyRoom.SelectedObject = _CurrentRoom;
|
||||
txtScript.Text = _CurrentRoom.Script;
|
||||
propertyRoom.SelectedObject = Program.Room;
|
||||
txtScript.Text = Program.Room.Script;
|
||||
}
|
||||
|
||||
private void SetupRoomScript()
|
||||
{
|
||||
//Check if the rooms script is empty. If so then generate a standard script for it.
|
||||
if (String.IsNullOrEmpty(_CurrentRoom.Script))
|
||||
if (String.IsNullOrEmpty(Program.Room.Script))
|
||||
{
|
||||
//Instance a new method helper class
|
||||
ManagedScripting.CodeBuilding.MethodSetup method = new ManagedScripting.CodeBuilding.MethodSetup();
|
||||
|
@ -108,9 +102,9 @@ namespace MudDesigner.Editors
|
|||
method.IsOverride = true;
|
||||
method.Modifier = ManagedScripting.CodeBuilding.ClassGenerator.Modifiers.Public;
|
||||
method.Code = new string[] { "base." + method.Name + "();" };
|
||||
script = script.Insert(_CurrentRoom.Script.Length, method.Create() + "\n");
|
||||
script = script.Insert(Program.Room.Script.Length, method.Create() + "\n");
|
||||
}
|
||||
_CurrentRoom.Script = script;
|
||||
Program.Room.Script = script;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -177,11 +171,11 @@ namespace MudDesigner.Editors
|
|||
//and was found for editing
|
||||
bool IsFound = false;
|
||||
|
||||
//Loop through each doorway installed within the _CurrentRoom and see if the user has
|
||||
//Loop through each doorway installed within the Program.Room and see if the user has
|
||||
//selected a direction that belongs to a _CurrentDoor already created. If a _CurrentDoor with
|
||||
//the selected direction is found, we display it's properties for editing instead
|
||||
//of creating a new _CurrentDoor and overwriting the previously created doorway.
|
||||
foreach (Door newDoor in _CurrentRoom.InstalledDoors)
|
||||
foreach (Door newDoor in Program.Room.InstalledDoors)
|
||||
{
|
||||
//Check if the current _CurrentDoor in the loop matches the currently selected
|
||||
//travel direction the user has selected in the listbox.
|
||||
|
@ -200,7 +194,7 @@ namespace MudDesigner.Editors
|
|||
}
|
||||
}
|
||||
|
||||
//There isn't a _CurrentDoor installed into the _CurrentRoom yet with a travel direction
|
||||
//There isn't a _CurrentDoor installed into the Program.Room yet with a travel direction
|
||||
//matching that of the users currently selected travel direction within the listbox.
|
||||
//so we instance a new _CurrentDoor
|
||||
if (!IsFound)
|
||||
|
@ -253,7 +247,7 @@ namespace MudDesigner.Editors
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Installs the _CurrentDoor into the _CurrentRoom's collection of doorways
|
||||
/// Installs the _CurrentDoor into the Program.Room's collection of doorways
|
||||
/// </summary>
|
||||
private void InstallDoor()
|
||||
{
|
||||
|
@ -262,10 +256,10 @@ namespace MudDesigner.Editors
|
|||
bool IsInstalled = false;
|
||||
|
||||
//Incase there are no existing doors, the foreach loop gets skipped.
|
||||
if (_CurrentRoom.InstalledDoors.Count == 0)
|
||||
if (Program.Room.InstalledDoors.Count == 0)
|
||||
{
|
||||
//Add the new door to the room
|
||||
_CurrentRoom.InstalledDoors.Add(_CurrentDoor);
|
||||
Program.Room.InstalledDoors.Add(_CurrentDoor);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -274,19 +268,19 @@ namespace MudDesigner.Editors
|
|||
//that the user has selected within the list box. If so then we
|
||||
//need to prompt the user to ensure it's ok to overwrite the previous
|
||||
//door with a new door.
|
||||
foreach (Door newDoor in _CurrentRoom.InstalledDoors)
|
||||
foreach (Door newDoor in Program.Room.InstalledDoors)
|
||||
{
|
||||
if (newDoor.TravelDirection == _CurrentDoor.TravelDirection)
|
||||
{
|
||||
_CurrentRoom.InstalledDoors.Remove(newDoor);
|
||||
_CurrentRoom.InstalledDoors.Add(_CurrentDoor);
|
||||
Program.Room.InstalledDoors.Remove(newDoor);
|
||||
Program.Room.InstalledDoors.Add(_CurrentDoor);
|
||||
IsInstalled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!IsInstalled)
|
||||
_CurrentRoom.InstalledDoors.Add(_CurrentDoor);
|
||||
Program.Room.InstalledDoors.Add(_CurrentDoor);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -294,11 +288,11 @@ namespace MudDesigner.Editors
|
|||
/// </summary>
|
||||
private void UninstallDoor()
|
||||
{
|
||||
foreach (Door door in _CurrentRoom.InstalledDoors)
|
||||
foreach (Door door in Program.Room.InstalledDoors)
|
||||
{
|
||||
if (door.TravelDirection == _CurrentDoor.TravelDirection)
|
||||
{
|
||||
_CurrentRoom.InstalledDoors.Remove(door);
|
||||
Program.Room.InstalledDoors.Remove(door);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -315,18 +309,18 @@ namespace MudDesigner.Editors
|
|||
if (result == DialogResult.No)
|
||||
return;
|
||||
|
||||
_CurrentRoom = new Room();
|
||||
Program.Room = new Room();
|
||||
_CurrentDoor = new Door(AvailableTravelDirections.None);
|
||||
SetupRoomScript();
|
||||
|
||||
propertyDoor.SelectedObject = null;
|
||||
propertyRoom.SelectedObject = _CurrentRoom;
|
||||
propertyRoom.SelectedObject = Program.Room;
|
||||
}
|
||||
|
||||
private void btnSaveRoom_Click(object sender, EventArgs e)
|
||||
{
|
||||
string savePath = Engine.GetDataPath(Engine.SaveDataTypes.Rooms);
|
||||
string filePath = System.IO.Path.Combine(savePath, _CurrentRoom.Name + ".room");
|
||||
string savePath = FileManager.GetDataPath(SaveDataTypes.Rooms);
|
||||
string filePath = System.IO.Path.Combine(savePath, Program.Room.Name + ".room");
|
||||
|
||||
if (System.IO.File.Exists(filePath))
|
||||
{
|
||||
|
@ -336,7 +330,7 @@ namespace MudDesigner.Editors
|
|||
return;
|
||||
}
|
||||
|
||||
FileSystem.Save(filePath, _CurrentRoom);
|
||||
FileManager.Save(filePath, Program.Room);
|
||||
MessageBox.Show("Saved.", "Room Designer");
|
||||
}
|
||||
|
||||
|
@ -344,28 +338,28 @@ namespace MudDesigner.Editors
|
|||
{
|
||||
if (tabObjects.SelectedTab.Text == "Script")
|
||||
{
|
||||
txtScript.Text = _CurrentRoom.Script;
|
||||
txtScript.Text = Program.Room.Script;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnCheckScript_Click(object sender, EventArgs e)
|
||||
{
|
||||
_ScriptEngine.Compiler = ManagedScripting.ScriptingEngine.CompilerSelections.SourceCompiler;
|
||||
_ScriptEngine.AddReference(Application.StartupPath + "/MUDEngine.dll");
|
||||
Program.ScriptEngine.Compiler = ManagedScripting.ScriptingEngine.CompilerSelections.SourceCompiler;
|
||||
Program.ScriptEngine.AddReference(Application.StartupPath + "/MUDEngine.dll");
|
||||
|
||||
string code = "namespace MudDesigner.MudEngine.Objects.Environment\n"
|
||||
+ "{\n"
|
||||
+ " public class " + _CurrentRoom.Name.Replace(" ", "") + " : Room\n"
|
||||
+ " public class " + Program.Room.Name.Replace(" ", "") + " : Room\n"
|
||||
+ " {\n"
|
||||
+ " " + txtScript.Text + "\n"
|
||||
+ " }\n"
|
||||
+ "}\n";
|
||||
MessageBox.Show(_ScriptEngine.Compile(code), "Script Compiling", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
MessageBox.Show(Program.ScriptEngine.Compile(code), "Script Compiling", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
|
||||
private void txtScript_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
_CurrentRoom.Script = txtScript.Text;
|
||||
Program.Room.Script = txtScript.Text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,6 @@ namespace MudDesigner.Editors
|
|||
ProjectSettings form = new ProjectSettings();
|
||||
|
||||
form.Show();
|
||||
|
||||
}
|
||||
|
||||
private void btnCurrencyEditor_Click(object sender, EventArgs e)
|
||||
|
|
|
@ -19,23 +19,19 @@ namespace MudDesigner.Editors
|
|||
{
|
||||
public partial class ZoneBuilder : Form
|
||||
{
|
||||
Zone _CurrentZone;
|
||||
Room _CurrentRoom;
|
||||
ScriptingEngine _ScriptEngine;
|
||||
|
||||
public ZoneBuilder()
|
||||
{
|
||||
InitializeComponent();
|
||||
_CurrentRoom = new Room();
|
||||
_CurrentZone = new Zone();
|
||||
_ScriptEngine = new ScriptingEngine();
|
||||
_ScriptEngine.CompileStyle = ManagedScripting.Compilers.BaseCompiler.ScriptCompileStyle.CompileToMemory;
|
||||
_ScriptEngine.Compiler = ScriptingEngine.CompilerSelections.SourceCompiler;
|
||||
Program.Room = new Room();
|
||||
Program.Zone = new Zone();
|
||||
Program.ScriptEngine = new ScriptingEngine();
|
||||
Program.ScriptEngine.CompileStyle = ManagedScripting.Compilers.BaseCompiler.ScriptCompileStyle.CompileToMemory;
|
||||
Program.ScriptEngine.Compiler = ScriptingEngine.CompilerSelections.SourceCompiler;
|
||||
|
||||
propertyZone.SelectedObject = _CurrentZone;
|
||||
txtScript.Text = _CurrentZone.Script;
|
||||
propertyZone.SelectedObject = Program.Zone;
|
||||
txtScript.Text = Program.Zone.Script;
|
||||
|
||||
string[] rooms = System.IO.Directory.GetFiles(MudEngine.Engine.GetDataPath(Engine.SaveDataTypes.Rooms), "*.room");
|
||||
string[] rooms = System.IO.Directory.GetFiles(FileManager.GetDataPath(SaveDataTypes.Rooms), "*.room");
|
||||
|
||||
foreach (string room in rooms)
|
||||
{
|
||||
|
@ -77,32 +73,32 @@ namespace MudDesigner.Editors
|
|||
|
||||
private void btnSaveZone_Click(object sender, EventArgs e)
|
||||
{
|
||||
string path = Engine.GetDataPath(Engine.SaveDataTypes.Zones);
|
||||
string filename = System.IO.Path.Combine(path, _CurrentZone.Name + ".zone");
|
||||
string path = FileManager.GetDataPath(SaveDataTypes.Zones);
|
||||
string filename = System.IO.Path.Combine(path, Program.Zone.Name + ".zone");
|
||||
|
||||
FileSystem.Save(filename, _CurrentZone);
|
||||
FileManager.Save(filename, Program.Zone);
|
||||
}
|
||||
|
||||
private void btnNewZone_Click(object sender, EventArgs e)
|
||||
{
|
||||
_CurrentZone = new Zone();
|
||||
_CurrentRoom = new Room();
|
||||
propertyZone.SelectedObject = _CurrentZone;
|
||||
Program.Zone = new Zone();
|
||||
Program.Room = new Room();
|
||||
propertyZone.SelectedObject = Program.Zone;
|
||||
}
|
||||
|
||||
private void btnValidateScript_Click(object sender, EventArgs e)
|
||||
{
|
||||
_ScriptEngine.Compiler = ManagedScripting.ScriptingEngine.CompilerSelections.SourceCompiler;
|
||||
_ScriptEngine.AddReference(Application.StartupPath + "/MUDEngine.dll");
|
||||
Program.ScriptEngine.Compiler = ManagedScripting.ScriptingEngine.CompilerSelections.SourceCompiler;
|
||||
Program.ScriptEngine.AddReference(Application.StartupPath + "/MUDEngine.dll");
|
||||
|
||||
string code = "namespace MudDesigner.MudEngine.Objects.Environment\n"
|
||||
+ "{\n"
|
||||
+ " public class " + _CurrentZone.Name.Replace(" ", "") + " : Zone\n"
|
||||
+ " public class " + Program.Zone.Name.Replace(" ", "") + " : Zone\n"
|
||||
+ " {\n"
|
||||
+ " " + txtScript.Text + "\n"
|
||||
+ " }\n"
|
||||
+ "}\n";
|
||||
MessageBox.Show(_ScriptEngine.Compile(code), "Script Compiling", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
MessageBox.Show(Program.ScriptEngine.Compile(code), "Script Compiling", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MudEngine\Engine.cs" />
|
||||
<Compile Include="MudEngine\FileSystem\SaveDataTypes.cs" />
|
||||
<Compile Include="MudEngine\GameObjects\BaseObject.cs" />
|
||||
<Compile Include="MudEngine\GameObjects\Currency.cs" />
|
||||
<Compile Include="MudEngine\GameObjects\Environment\Door.cs" />
|
||||
|
@ -61,6 +62,9 @@
|
|||
<Compile Include="MudEngine\GameObjects\Environment\Room.cs" />
|
||||
<Compile Include="MudEngine\GameObjects\Environment\TravelDirections.cs" />
|
||||
<Compile Include="MudEngine\GameObjects\Environment\Zone.cs" />
|
||||
<Compile Include="MudEngine\Interfaces\IGameObject.cs" />
|
||||
<Compile Include="MudEngine\Interfaces\IQuest.cs" />
|
||||
<Compile Include="MudEngine\Interfaces\IRuleSet.cs" />
|
||||
<Compile Include="MudEngine\ProjectInformation.cs" />
|
||||
<Compile Include="MudEngine\Attributes\UnusableAttribute.cs" />
|
||||
<Compile Include="Editors\CurrencyEditor.cs">
|
||||
|
@ -99,7 +103,8 @@
|
|||
<Compile Include="Editors\ProjectSettings.designer.cs">
|
||||
<DependentUpon>ProjectSettings.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MudEngine\FileSystem\FileSystem.cs" />
|
||||
<Compile Include="MudEngine\FileSystem\FileManager.cs" />
|
||||
<Compile Include="MudEngine\QuestSetup.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Editors\CurrencyEditor.resx">
|
||||
|
|
|
@ -6,71 +6,5 @@ using System.Text;
|
|||
namespace MudDesigner.MudEngine
|
||||
{
|
||||
public class Engine
|
||||
{
|
||||
|
||||
public enum SaveDataTypes
|
||||
{
|
||||
Root,
|
||||
Currency,
|
||||
Rooms,
|
||||
Zones,
|
||||
Realms,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used to ensure that the paths needed to run the game exists.
|
||||
/// If no path is supplied, the engine uses it's current install path.
|
||||
/// </summary>
|
||||
/// <param name="validatedPath"></param>
|
||||
public static void ValidateDataPaths()
|
||||
{
|
||||
string assemblyPath = System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName;
|
||||
string assemblyName = System.IO.Path.GetFileName(assemblyPath);
|
||||
string installBase = assemblyPath.Substring(0, assemblyPath.Length - assemblyName.Length);
|
||||
string rootPath = System.IO.Path.Combine(installBase, "Data");
|
||||
ValidateDataPaths(rootPath);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks the supplied directory to ensure that all of the engines needed
|
||||
/// data folders are created
|
||||
/// </summary>
|
||||
/// <param name="InstallPath"></param>
|
||||
public static void ValidateDataPaths(string InstallPath)
|
||||
{
|
||||
if (!InstallPath.EndsWith("data", true, null))
|
||||
InstallPath = System.IO.Path.Combine(InstallPath, "Data");
|
||||
|
||||
if (!System.IO.Directory.Exists(InstallPath))
|
||||
System.IO.Directory.CreateDirectory(InstallPath);
|
||||
|
||||
foreach (SaveDataTypes value in Enum.GetValues(typeof(SaveDataTypes)))
|
||||
{
|
||||
string dataType = value.ToString();
|
||||
if (value.ToString() == "Root")
|
||||
continue;
|
||||
|
||||
if (!System.IO.Directory.Exists(System.IO.Path.Combine(InstallPath, dataType)))
|
||||
System.IO.Directory.CreateDirectory(System.IO.Path.Combine(InstallPath, dataType));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the complete path to the specified data's save folder.
|
||||
/// </summary>
|
||||
/// <param name="DataType"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetDataPath(SaveDataTypes DataType)
|
||||
{
|
||||
string assemblyPath = System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName;
|
||||
string assemblyName = System.IO.Path.GetFileName(assemblyPath);
|
||||
string installBase = assemblyPath.Substring(0, assemblyPath.Length - assemblyName.Length);
|
||||
string rootPath = System.IO.Path.Combine(installBase, "Data");
|
||||
|
||||
if (DataType == SaveDataTypes.Root)
|
||||
return rootPath;
|
||||
else
|
||||
return System.IO.Path.Combine(rootPath, DataType.ToString());
|
||||
}
|
||||
}
|
||||
{ }
|
||||
}
|
||||
|
|
110
Mud Designer/MudEngine/FileSystem/FileManager.cs
Normal file
110
Mud Designer/MudEngine/FileSystem/FileManager.cs
Normal file
|
@ -0,0 +1,110 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MudDesigner.MudEngine.FileSystem
|
||||
{
|
||||
public static class FileManager
|
||||
{
|
||||
public enum OutputFormats
|
||||
{
|
||||
XML = 0,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The filetype that the MUDs files will be saved as
|
||||
/// </summary>
|
||||
public static OutputFormats FileType
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Saves the object using the specified output format
|
||||
/// </summary>
|
||||
/// <param name="Filename"></param>
|
||||
/// <param name="o"></param>
|
||||
public static void Save(string Filename, object o)
|
||||
{
|
||||
if (FileType == OutputFormats.XML)
|
||||
{
|
||||
XmlSerialization.Save(Filename, o);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads the object using the specified FileType format
|
||||
/// </summary>
|
||||
/// <param name="Filename"></param>
|
||||
/// <param name="o"></param>
|
||||
/// <returns></returns>
|
||||
public static object Load(string Filename, object o)
|
||||
{
|
||||
if (FileType == OutputFormats.XML)
|
||||
{
|
||||
return XmlSerialization.Load(Filename, o);
|
||||
}
|
||||
else return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used to ensure that the paths needed to run the game exists.
|
||||
/// If no path is supplied, the engine uses it's current install path.
|
||||
/// </summary>
|
||||
/// <param name="validatedPath"></param>
|
||||
public static void ValidateDataPaths()
|
||||
{
|
||||
string assemblyPath = System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName;
|
||||
string assemblyName = System.IO.Path.GetFileName(assemblyPath);
|
||||
string installBase = assemblyPath.Substring(0, assemblyPath.Length - assemblyName.Length);
|
||||
string rootPath = System.IO.Path.Combine(installBase, "Data");
|
||||
ValidateDataPaths(rootPath);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks the supplied directory to ensure that all of the engines needed
|
||||
/// data folders are created. Only use if you want to point your projects in
|
||||
/// different directory other than InstallBase\Data
|
||||
/// </summary>
|
||||
/// <param name="InstallPath"></param>
|
||||
public static void ValidateDataPaths(string InstallPath)
|
||||
{
|
||||
if (!InstallPath.EndsWith("data", true, null))
|
||||
InstallPath = System.IO.Path.Combine(InstallPath, "Data");
|
||||
|
||||
if (!System.IO.Directory.Exists(InstallPath))
|
||||
System.IO.Directory.CreateDirectory(InstallPath);
|
||||
|
||||
foreach (SaveDataTypes value in Enum.GetValues(typeof(SaveDataTypes)))
|
||||
{
|
||||
string dataType = value.ToString();
|
||||
if (value.ToString() == "Root")
|
||||
continue;
|
||||
|
||||
if (!System.IO.Directory.Exists(System.IO.Path.Combine(InstallPath, dataType)))
|
||||
System.IO.Directory.CreateDirectory(System.IO.Path.Combine(InstallPath, dataType));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the complete path to the specified data's save folder.
|
||||
/// </summary>
|
||||
/// <param name="DataType"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetDataPath(SaveDataTypes DataType)
|
||||
{
|
||||
string assemblyPath = System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName;
|
||||
string assemblyName = System.IO.Path.GetFileName(assemblyPath);
|
||||
string installBase = assemblyPath.Substring(0, assemblyPath.Length - assemblyName.Length);
|
||||
string rootPath = System.IO.Path.Combine(installBase, "Data");
|
||||
|
||||
if (DataType == SaveDataTypes.Root)
|
||||
return rootPath;
|
||||
else
|
||||
return System.IO.Path.Combine(rootPath, DataType.ToString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MudDesigner.MudEngine.FileSystem
|
||||
{
|
||||
public static class FileSystem
|
||||
{
|
||||
public enum OutputFormats
|
||||
{
|
||||
XML = 0,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The filetype that the MUDs files will be saved as
|
||||
/// </summary>
|
||||
public static OutputFormats FileType
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Saves the object using the specified output format
|
||||
/// </summary>
|
||||
/// <param name="Filename"></param>
|
||||
/// <param name="o"></param>
|
||||
public static void Save(string Filename, object o)
|
||||
{
|
||||
if (FileType == OutputFormats.XML)
|
||||
{
|
||||
XmlSerialization.Save(Filename, o);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads the object using the specified FileType format
|
||||
/// </summary>
|
||||
/// <param name="Filename"></param>
|
||||
/// <param name="o"></param>
|
||||
/// <returns></returns>
|
||||
public static object Load(string Filename, object o)
|
||||
{
|
||||
if (FileType == OutputFormats.XML)
|
||||
{
|
||||
return XmlSerialization.Load(Filename, o);
|
||||
}
|
||||
else return null;
|
||||
}
|
||||
}
|
||||
}
|
11
Mud Designer/MudEngine/FileSystem/SaveDataTypes.cs
Normal file
11
Mud Designer/MudEngine/FileSystem/SaveDataTypes.cs
Normal file
|
@ -0,0 +1,11 @@
|
|||
namespace MudDesigner.MudEngine.FileSystem
|
||||
{
|
||||
public enum SaveDataTypes
|
||||
{
|
||||
Root,
|
||||
Currency,
|
||||
Rooms,
|
||||
Zones,
|
||||
Realms,
|
||||
}
|
||||
}
|
|
@ -5,10 +5,11 @@ using System.Text;
|
|||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml.Serialization;
|
||||
using MudDesigner.MudEngine.Interfaces;
|
||||
|
||||
namespace MudDesigner.MudEngine.Objects
|
||||
{
|
||||
public class BaseObject
|
||||
public class BaseObject : IGameObject
|
||||
{
|
||||
[Category("Object Setup")]
|
||||
[RefreshProperties(RefreshProperties.All)] //Required to refresh Filename property in the editors propertygrid
|
||||
|
@ -107,5 +108,21 @@ namespace MudDesigner.MudEngine.Objects
|
|||
public virtual void OnDestroy()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnEquip()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnUnequip()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnMount()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnDismount()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
27
Mud Designer/MudEngine/Interfaces/IGameObject.cs
Normal file
27
Mud Designer/MudEngine/Interfaces/IGameObject.cs
Normal file
|
@ -0,0 +1,27 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MudDesigner.MudEngine.Interfaces
|
||||
{
|
||||
public interface IGameObject
|
||||
{
|
||||
string Name { get; set; }
|
||||
|
||||
string Description { get; set; }
|
||||
|
||||
string Script { get; set; }
|
||||
|
||||
string Filename { get; }
|
||||
|
||||
void OnCreate();
|
||||
void OnDestroy();
|
||||
void OnEnter();
|
||||
void OnExit();
|
||||
void OnEquip();
|
||||
void OnUnequip();
|
||||
void OnMount();
|
||||
void OnDismount();
|
||||
}
|
||||
}
|
22
Mud Designer/MudEngine/Interfaces/IQuest.cs
Normal file
22
Mud Designer/MudEngine/Interfaces/IQuest.cs
Normal file
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using MudDesigner.MudEngine.Objects;
|
||||
namespace MudDesigner.MudEngine.Interfaces
|
||||
{
|
||||
interface IQuest
|
||||
{
|
||||
string Title { get; set; }
|
||||
string Description { get; set; }
|
||||
int ExperianceAward { get; set; }
|
||||
int MinimumLevel { get; set; }
|
||||
int MaximumLevel { get; set; }
|
||||
|
||||
//This or int? i'm not sure
|
||||
Currency CurrencyAward { get; set; }
|
||||
void AcceptQuest();
|
||||
void CompleteQuest();
|
||||
void TrashQuest();
|
||||
}
|
||||
}
|
12
Mud Designer/MudEngine/Interfaces/IRuleSet.cs
Normal file
12
Mud Designer/MudEngine/Interfaces/IRuleSet.cs
Normal file
|
@ -0,0 +1,12 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MudDesigner.MudEngine.Interfaces
|
||||
{
|
||||
public interface IRuleSet
|
||||
{
|
||||
void Initialize();
|
||||
}
|
||||
}
|
11
Mud Designer/MudEngine/QuestSetup.cs
Normal file
11
Mud Designer/MudEngine/QuestSetup.cs
Normal file
|
@ -0,0 +1,11 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MudDesigner.MudEngine
|
||||
{
|
||||
public class QuestSetup
|
||||
{
|
||||
}
|
||||
}
|
|
@ -14,19 +14,24 @@ namespace MudDesigner
|
|||
static class Program
|
||||
{
|
||||
public static ProjectInformation Project{ get; set; }
|
||||
public static Realm Realm { get; set; }
|
||||
public static Zone Zone {get;set;}
|
||||
public static Room Room { get; set; }
|
||||
public static ManagedScripting.ScriptingEngine ScriptEngine { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Engine.ValidateDataPaths();
|
||||
FileSystem.FileType = FileSystem.OutputFormats.XML;
|
||||
FileManager.ValidateDataPaths();
|
||||
FileManager.FileType = FileManager.OutputFormats.XML;
|
||||
Project = new ProjectInformation();
|
||||
|
||||
string filename = System.IO.Path.Combine(Engine.GetDataPath(Engine.SaveDataTypes.Root), "Project.Xml");
|
||||
string filename = System.IO.Path.Combine(FileManager.GetDataPath(SaveDataTypes.Root), "Project.Xml");
|
||||
if (System.IO.File.Exists(filename))
|
||||
Project = (ProjectInformation)FileSystem.Load(filename, Project);
|
||||
Project = (ProjectInformation)FileManager.Load(filename, Project);
|
||||
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue