MudEngine:

- Minor tweaks to Room.cs for checking file extension validity
 - Scripting Engine and related classes added to Solution (Files existed but were not a part of solution)
This commit is contained in:
Scionwest_cp 2010-07-17 09:55:43 -07:00
parent 2c9536a02c
commit 06266b7245
3 changed files with 9 additions and 5 deletions

View file

@ -133,9 +133,9 @@ namespace MudEngine.GameObjects.Environment
/// <returns></returns> /// <returns></returns>
public override object Load(string roomName) public override object Load(string roomName)
{ {
//Correct the roomname incase it doesnt contain a file extension //Correct the filename incase it doesnt contain a file extension
if (!roomName.ToLower().EndsWith(".room")) if (!roomName.ToLower().EndsWith(this.GetType().Name.ToLower()))
roomName += ".room"; roomName.Insert(roomName.Length, this.GetType().Name.ToLower());
//If the current room does not belong within a Realm, then load it from the //If the current room does not belong within a Realm, then load it from the
//Zones root directory //Zones root directory

View file

@ -65,6 +65,10 @@
<Compile Include="GameObjects\Items\BaseItem.cs" /> <Compile Include="GameObjects\Items\BaseItem.cs" />
<Compile Include="GameObjects\Currency.cs" /> <Compile Include="GameObjects\Currency.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Scripting\GameObject.cs" />
<Compile Include="Scripting\GameObjectCollection.cs" />
<Compile Include="Scripting\ScriptEngine.cs" />
<Compile Include="Scripting\StartupObject.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="GameObjects\Characters\NPC\" /> <Folder Include="GameObjects\Characters\NPC\" />

View file

@ -60,12 +60,12 @@ namespace MudEngine.Scripting
return previousProperty.GetValue(Instance, null); return previousProperty.GetValue(Instance, null);
} }
/* Dynamic Type Instancing isn't supported in .NET 3.5; Requires 4.0
public dynamic GetProperty() public dynamic GetProperty()
{ {
return Instance; return Instance;
} }
*/
public object InvokeMethod(string methodName, params object[] parameters) public object InvokeMethod(string methodName, params object[] parameters)
{ {
MethodInfo method = Instance.GetType().GetMethod(methodName); MethodInfo method = Instance.GetType().GetMethod(methodName);