Index: /code/branches/consolecommands3/src/libraries/core/Executor.h
===================================================================
--- /code/branches/consolecommands3/src/libraries/core/Executor.h	(revision 7187)
+++ /code/branches/consolecommands3/src/libraries/core/Executor.h	(revision 7188)
@@ -68,11 +68,11 @@
             inline bool hasReturnvalue() const
                 { return this->functor_->hasReturnvalue(); }
-            inline FunctionType::Value getType() const
+            inline Functor::Type::Enum getType() const
                 { return this->functor_->getType(); }
             inline const MultiType& getReturnvalue() const
                 { return this->functor_->getReturnvalue(); }
-            inline const std::string& getTypenameParam(unsigned int param) const
+            inline std::string getTypenameParam(unsigned int param) const
                 { return this->functor_->getTypenameParam(param); }
-            inline const std::string& getTypenameReturnvalue() const
+            inline std::string getTypenameReturnvalue() const
                 { return this->functor_->getTypenameReturnvalue(); }
 
Index: /code/branches/consolecommands3/src/libraries/core/Functor.h
===================================================================
--- /code/branches/consolecommands3/src/libraries/core/Functor.h	(revision 7187)
+++ /code/branches/consolecommands3/src/libraries/core/Functor.h	(revision 7188)
@@ -42,15 +42,4 @@
 {
     const unsigned int MAX_FUNCTOR_ARGUMENTS = 5;
-
-    namespace FunctionType
-    {
-        enum Value
-        {
-            Member,
-            ConstMember,
-            Static
-        };
-    }
-
 
     template <class T>
@@ -100,4 +89,16 @@
     {
         public:
+            struct Type
+            {
+                enum Enum
+                {
+                    Member,
+                    ConstMember,
+                    Static,
+                    Lua
+                };
+            };
+
+        public:
             Functor() {}
             virtual ~Functor() {}
@@ -105,11 +106,12 @@
             virtual void operator()(const MultiType& param1 = MT_Type::Null, const MultiType& param2 = MT_Type::Null, const MultiType& param3 = MT_Type::Null, const MultiType& param4 = MT_Type::Null, const MultiType& param5 = MT_Type::Null) = 0;
 
-            inline unsigned int getParamCount() const { return this->numParams_; }
-            inline bool hasReturnvalue() const { return this->hasReturnValue_; }
-            inline FunctionType::Value getType() const { return this->type_; }
             inline const MultiType& getReturnvalue() const { return this->returnedValue_; }
 
-            const std::string& getTypenameParam(unsigned int param) const { return (param < 5) ? this->typeParam_[param] : BLANKSTRING; }
-            const std::string& getTypenameReturnvalue() const { return this->typeReturnvalue_; }
+            virtual Type::Enum getType() const = 0;
+            virtual unsigned int getParamCount() const = 0;
+            virtual bool hasReturnvalue() const = 0;
+
+            virtual std::string getTypenameParam(unsigned int param) const = 0;
+            virtual std::string getTypenameReturnvalue() const = 0;
 
             virtual void evaluateParam(unsigned int index, MultiType& param) const = 0;
@@ -121,11 +123,5 @@
 
         protected:
-            unsigned int numParams_;
-            bool hasReturnValue_;
-            FunctionType::Value type_;
             MultiType returnedValue_;
-
-            std::string typeReturnvalue_;
-            std::string typeParam_[MAX_FUNCTOR_ARGUMENTS];
     };
 
@@ -286,15 +282,36 @@
 
 
-#define FUNCTOR_TYPENAME_PARAMS(numparams) FUNCTOR_TYPENAME_PARAMS##numparams
-#define FUNCTOR_TYPENAME_PARAMS0
-#define FUNCTOR_TYPENAME_PARAMS1 this->typeParam_[0] = typeToString<P1>();
-#define FUNCTOR_TYPENAME_PARAMS2 this->typeParam_[0] = typeToString<P1>(); this->typeParam_[1] = typeToString<P2>();
-#define FUNCTOR_TYPENAME_PARAMS3 this->typeParam_[0] = typeToString<P1>(); this->typeParam_[1] = typeToString<P2>(); this->typeParam_[2] = typeToString<P3>();
-#define FUNCTOR_TYPENAME_PARAMS4 this->typeParam_[0] = typeToString<P1>(); this->typeParam_[1] = typeToString<P2>(); this->typeParam_[2] = typeToString<P3>(); this->typeParam_[3] = typeToString<P4>();
-#define FUNCTOR_TYPENAME_PARAMS5 this->typeParam_[0] = typeToString<P1>(); this->typeParam_[1] = typeToString<P2>(); this->typeParam_[2] = typeToString<P3>(); this->typeParam_[3] = typeToString<P4>(); this->typeParam_[4] = typeToString<P5>();
+#define FUNCTOR_TYPENAME_PARAM(numparams) FUNCTOR_TYPENAME_PARAM##numparams
+#define FUNCTOR_TYPENAME_PARAM0 \
+    return BLANKSTRING
+#define FUNCTOR_TYPENAME_PARAM1 \
+    if (param == 0) { return typeToString<P1>(); } \
+    else { return BLANKSTRING; }
+#define FUNCTOR_TYPENAME_PARAM2 \
+    if (param == 0) { return typeToString<P1>(); } \
+    else if (param == 1) { return typeToString<P2>(); } \
+    else { return BLANKSTRING; }
+#define FUNCTOR_TYPENAME_PARAM3 \
+    if (param == 0) { return typeToString<P1>(); } \
+    else if (param == 1) { return typeToString<P2>(); } \
+    else if (param == 2) { return typeToString<P3>(); } \
+    else { return BLANKSTRING; }
+#define FUNCTOR_TYPENAME_PARAM4 \
+    if (param == 0) { return typeToString<P1>(); } \
+    else if (param == 1) { return typeToString<P2>(); } \
+    else if (param == 2) { return typeToString<P3>(); } \
+    else if (param == 3) { return typeToString<P4>(); } \
+    else { return BLANKSTRING; }
+#define FUNCTOR_TYPENAME_PARAM5 \
+    if (param == 0) { return typeToString<P1>(); } \
+    else if (param == 1) { return typeToString<P2>(); } \
+    else if (param == 2) { return typeToString<P3>(); } \
+    else if (param == 3) { return typeToString<P4>(); } \
+    else if (param == 4) { return typeToString<P5>(); } \
+    else { return BLANKSTRING; }
 
 #define FUNCTOR_TYPENAME_RETURN(returnvalue) FUNCTOR_TYPENAME_RETURN##returnvalue
-#define FUNCTOR_TYPENAME_RETURN0
-#define FUNCTOR_TYPENAME_RETURN1 this->typeReturnvalue_ = typeToString<R>();
+#define FUNCTOR_TYPENAME_RETURN0 BLANKSTRING
+#define FUNCTOR_TYPENAME_RETURN1 typeToString<R>()
 
 
@@ -375,11 +392,5 @@
             FunctorStatic##returnvalue##numparams(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams))) \
             { \
-                this->numParams_ = numparams; \
-                this->hasReturnValue_ = returnvalue; \
-                this->type_ = FunctionType::Static; \
                 this->functionPointer_ = functionPointer; \
-                \
-                FUNCTOR_TYPENAME_PARAMS(numparams); \
-                FUNCTOR_TYPENAME_RETURN(returnvalue); \
             } \
     \
@@ -393,4 +404,10 @@
                 FUNCTOR_EVALUATE_PARAM(numparams); \
             } \
+    \
+            Functor::Type::Enum getType() const { return Functor::Type::Static; } \
+            unsigned int getParamCount() const { return numparams; } \
+            bool hasReturnvalue() const { return returnvalue; } \
+            std::string getTypenameParam(unsigned int param) const { FUNCTOR_TYPENAME_PARAM(numparams); } \
+            std::string getTypenameReturnvalue() const { return FUNCTOR_TYPENAME_RETURN(returnvalue); } \
     \
             const std::type_info& getHeaderIdentifier() const \
@@ -421,7 +438,4 @@
             FunctorMember##returnvalue##numparams(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams))) \
             { \
-                this->numParams_ = numparams; \
-                this->hasReturnValue_ = returnvalue; \
-                this->type_ = FunctionType::Member; \
                 this->functionPointer_ = functionPointer; \
             } \
@@ -442,4 +456,10 @@
                 FUNCTOR_EVALUATE_PARAM(numparams); \
             } \
+    \
+            Functor::Type::Enum getType() const { return Functor::Type::Member; } \
+            unsigned int getParamCount() const { return numparams; } \
+            bool hasReturnvalue() const { return returnvalue; } \
+            std::string getTypenameParam(unsigned int param) const { FUNCTOR_TYPENAME_PARAM(numparams); } \
+            std::string getTypenameReturnvalue() const { return FUNCTOR_TYPENAME_RETURN(returnvalue); } \
     \
             const std::type_info& getHeaderIdentifier() const \
@@ -459,7 +479,4 @@
             FunctorConstMember##returnvalue##numparams(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams)) const) \
             { \
-                this->numParams_ = numparams; \
-                this->hasReturnValue_ = returnvalue; \
-                this->type_ = FunctionType::ConstMember; \
                 this->functionPointer_ = functionPointer; \
             } \
@@ -479,4 +496,10 @@
                 FUNCTOR_EVALUATE_PARAM(numparams); \
             } \
+    \
+            Functor::Type::Enum getType() const { return Functor::Type::ConstMember; } \
+            unsigned int getParamCount() const { return numparams; } \
+            bool hasReturnvalue() const { return returnvalue; } \
+            std::string getTypenameParam(unsigned int param) const { FUNCTOR_TYPENAME_PARAM(numparams); } \
+            std::string getTypenameReturnvalue() const { return FUNCTOR_TYPENAME_RETURN(returnvalue); } \
     \
             const std::type_info& getHeaderIdentifier() const \
Index: /code/branches/consolecommands3/src/libraries/core/LuaState.h
===================================================================
--- /code/branches/consolecommands3/src/libraries/core/LuaState.h	(revision 7187)
+++ /code/branches/consolecommands3/src/libraries/core/LuaState.h	(revision 7188)
@@ -54,4 +54,11 @@
             void operator()(const MultiType& param1 = MT_Type::Null, const MultiType& param2 = MT_Type::Null, const MultiType& param3 = MT_Type::Null, const MultiType& param4 = MT_Type::Null, const MultiType& param5 = MT_Type::Null);
             void evaluateParam(unsigned int index, MultiType& param) const {}
+
+            Functor::Type::Enum getType() const { return Functor::Type::Lua; } \
+            unsigned int getParamCount() const { return 0; }
+            bool hasReturnvalue() const { return 0; }
+            std::string getTypenameParam(unsigned int param) const { return BLANKSTRING; }
+            std::string getTypenameReturnvalue() const { return BLANKSTRING; }
+
             const std::type_info& getHeaderIdentifier() const { return typeid(this); }
 
