19 static constexpr size_t unlimitedArgs = std::numeric_limits<int>::max();
27 ScriptGlobalEntry(
const std::string& name,
const std::string& description,
int argumentCount);
107 int _argumentCount{0};
141 result = _self->*_func(arguments);
sf::ScriptGlobalEntry derived class to link static functions or methods using a closure.
Definition ScriptGlobalEntry.h:168
ScriptGlobalEntryClosure(const std::string &name, const std::string &description, int arg_count)
ClosureType onCall
Closure handling the call.
Definition ScriptGlobalEntry.h:181
ScriptGlobalEntryClosure(const StaticScriptGlobalEntry &)=delete
No copying allowed.
ScriptGlobalEntryClosure & operator=(const StaticScriptGlobalEntry &)=delete
No copying allowed.
TClosure< Value, const Value::vector_type & > ClosureType
Definition ScriptGlobalEntry.h:170
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.
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.
virtual ~ScriptGlobalEntry()
Destructor. Removes itself from the mapped entries.
std::string _description
Holds description of the entry.
Definition ScriptGlobalEntry.h:103
static string_list getEntryStringList(bool descriptive)
Gets a string list containing all available global script functions.
std::string getName() const
Gets the name of the entry.
std::string _name
Holds the name of the entry.
Definition ScriptGlobalEntry.h:99
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.
sf::ScriptGlobalEntry derived class to link static functions or methods.
Definition ScriptGlobalEntry.h:148
StaticScriptGlobalEntry(FunctionType func, const std::string &name, const std::string &description, int arg_count)
StaticScriptGlobalEntry & operator=(const StaticScriptGlobalEntry &)=delete
StaticScriptGlobalEntry(const StaticScriptGlobalEntry &)=delete
Encapsulates the std::function() template.
Definition TClosure.h:14
Template for creating a script global entry linking a dynamic created method.
Definition ScriptGlobalEntry.h:117
TScriptGlobalEntry(T *self, FunctionType func, const std::string &name, int argumentCount, const std::string &description)
Definition ScriptGlobalEntry.h:121
TScriptGlobalEntry & operator=(const TScriptGlobalEntry &)=delete
TScriptGlobalEntry(const TScriptGlobalEntry &)=delete
Value(T::* FunctionType)(const Value::vector_type &)
Definition ScriptGlobalEntry.h:119
Counted vector having additional methods and operators for ease of usage. This template class extends...
Definition TVector.h:19
Value container class able to performing arithmetic functions.
Definition Value.h:19
#define _MISC_CLASS
Definition misc/global.h:40
Definition Application.h:10
TStrings< std::string > string_list
Vector of std::strings with additional functionality.
Definition TStrings.h:97