ezEngine  Milestone 7
ConsoleFunction.h
1 #pragma once
2 
3 #include <CoreUtils/Basics.h>
5 #include <Foundation/Types/Variant.h>
6 
35 class EZ_COREUTILS_DLL ezConsoleFunctionBase : public ezEnumerable<ezConsoleFunctionBase>
36 {
38 
39 public:
40 
42  ezConsoleFunctionBase(const char* szFunctionName, const char* szDescription)
43  {
44  m_szFunctionName = szFunctionName;
45  m_szDescription = szDescription;
46  }
47 
49  const char* GetName() const { return m_szFunctionName; }
50 
52  const char* GetDescription() const { return m_szDescription; }
53 
55  virtual ezUInt32 GetNumParameters() const = 0;
56 
58  virtual ezVariant::Type::Enum GetParameterType(ezUInt32 uiParam) const = 0;
59 
64  virtual ezResult Call(ezArrayPtr<ezVariant> params) = 0;
65 
66 private:
67  const char* m_szFunctionName;
68  const char* m_szDescription;
69 };
70 
71 
73 template<typename R>
75 {
76 };
77 
78 
79 #define ARG_COUNT 0
80 #include <CoreUtils/Console/Implementation/ConsoleFunctionHelper_inl.h>
81 #undef ARG_COUNT
82 
83 #define ARG_COUNT 1
84 #include <CoreUtils/Console/Implementation/ConsoleFunctionHelper_inl.h>
85 #undef ARG_COUNT
86 
87 #define ARG_COUNT 2
88 #include <CoreUtils/Console/Implementation/ConsoleFunctionHelper_inl.h>
89 #undef ARG_COUNT
90 
91 #define ARG_COUNT 3
92 #include <CoreUtils/Console/Implementation/ConsoleFunctionHelper_inl.h>
93 #undef ARG_COUNT
94 
95 #define ARG_COUNT 4
96 #include <CoreUtils/Console/Implementation/ConsoleFunctionHelper_inl.h>
97 #undef ARG_COUNT
98 
99 #define ARG_COUNT 5
100 #include <CoreUtils/Console/Implementation/ConsoleFunctionHelper_inl.h>
101 #undef ARG_COUNT
102 
103 #define ARG_COUNT 6
104 #include <CoreUtils/Console/Implementation/ConsoleFunctionHelper_inl.h>
105 #undef ARG_COUNT
106