19 static constexpr size_t unlimitedArgs = std::numeric_limits<int>::max();
27 ScriptGlobalEntry(
const std::string& name,
const std::string& description,
int argumentCount);
58 _description = description;
76 return _argumentCount;
113 int _argumentCount{0};
140 result = _self->*_func(arguments);
167 result = (*_func)(arguments);
Pure virtual class to register script accessible entries through the use of sf::ScriptGlobalObject cl...
Definition ScriptGlobalEntry.h:14
static bool call(const std::string &name, const Value::vector_type &arguments, Value &result)
Finds the function with name 'name' and returns true when the function was found passing the correct ...
int getArgumentCount() const
Gets the amount of parameters that is needed for this function.
Definition ScriptGlobalEntry.h:74
ScriptGlobalEntry(const ScriptGlobalEntry &)=delete
Not allowed to copy.
ScriptGlobalEntry(const std::string &name, const std::string &description, int argumentCount)
Default Constructor adding itself to the global mapped entries.
virtual void call(const Value::vector_type &arguments, Value &result) const =0
Must be implemented to be able to call the function.
ScriptGlobalEntry & operator=(const ScriptGlobalEntry &)=delete
Not allowed to copy.
std::string getDescription() const
Gets the description of the entry.
Definition ScriptGlobalEntry.h:64
virtual ~ScriptGlobalEntry()
Destructor. Removes itself from the mapped entries.
std::string _description
Holds description of the entry.
Definition ScriptGlobalEntry.h:109
std::string getName() const
Gets the name of the entry.
Definition ScriptGlobalEntry.h:48
std::string _name
Holds the name of the entry.
Definition ScriptGlobalEntry.h:105
static ScriptGlobalEntry * getEntry(const std::string &name)
Gets the entry pointer by name.
void setDescription(const std::string &description)
Sets the description of the entry.
Definition ScriptGlobalEntry.h:56
sf::ScriptGlobalEntry derived class to link static functions or methods.
Definition ScriptGlobalEntry.h:151
ScriptGlobalStaticEntry(const ScriptGlobalStaticEntry &)=delete
Value(* FunctionType)(const Value::vector_type &arguments)
Definition ScriptGlobalEntry.h:153
ScriptGlobalStaticEntry & operator=(const ScriptGlobalStaticEntry &)=delete
ScriptGlobalStaticEntry(FunctionType func, const std::string &name, const std::string &description, int argumentCount)
Definition ScriptGlobalEntry.h:155
Template for creating a script global entry linking a dynamic created method.
Definition ScriptGlobalEntry.h:123
TScriptGlobalEntry(T *self, FunctionType func, const std::string &name, int argumentCount, const std::string &description)
Definition ScriptGlobalEntry.h:127
TScriptGlobalEntry & operator=(const TScriptGlobalEntry &)=delete
TScriptGlobalEntry(const TScriptGlobalEntry &)=delete
Value(T::* FunctionType)(const Value::vector_type &)
Definition ScriptGlobalEntry.h:125
Counted vector having additional methods and operators for ease of usage.
Definition TVector.h:25
Value container class able to performing arithmetic functions.
Definition Value.h:19
#define _MISC_CLASS
Definition misc/global.h:40
Definition Application.h:10