From ba95d6b07011ff5ca2523ea1d384a23f8cdf29d1 Mon Sep 17 00:00:00 2001 From: Scionwest_cp Date: Sun, 18 Jul 2010 14:41:04 -0700 Subject: [PATCH] MudEngine: - GameObject.GetProperty now supports returning Dynamic Types (Requires .NET 4.0) --- MudEngine/Scripting/GameObject.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/MudEngine/Scripting/GameObject.cs b/MudEngine/Scripting/GameObject.cs index 51fbfdb..7c41f66 100644 --- a/MudEngine/Scripting/GameObject.cs +++ b/MudEngine/Scripting/GameObject.cs @@ -47,12 +47,7 @@ namespace MudEngine.Scripting } } } - /* Dynamic Type Instancing isn't supported in .NET 3.5 - public dynamic SetProperty() - { - return Instance; - } - */ + public object GetProperty(string propertyName) { string[] tokens = propertyName.Split('.'); @@ -60,12 +55,12 @@ namespace MudEngine.Scripting return previousProperty.GetValue(Instance, null); } - /* Dynamic Type Instancing isn't supported in .NET 3.5; Requires 4.0 + public dynamic GetProperty() { return Instance; } - */ + public object InvokeMethod(string methodName, params object[] parameters) { MethodInfo method = Instance.GetType().GetMethod(methodName);