OpenTTD Source 20250711-master-gaaf5d39b15
|
The template to define classes in Squirrel. More...
#include <squirrel_class.hpp>
Public Member Functions | |
DefSQClass (std::string_view _classname) | |
template<typename Func > | |
void | DefSQMethod (Squirrel &engine, Func function_proc, std::string_view function_name, std::string_view params={}) |
This defines a method inside a class for Squirrel with defined params. | |
template<typename Func > | |
void | DefSQAdvancedMethod (Squirrel &engine, Func function_proc, std::string_view function_name) |
This defines a method inside a class for Squirrel, which has access to the 'engine' (experts only!). | |
template<typename Func > | |
void | DefSQStaticMethod (Squirrel &engine, Func function_proc, std::string_view function_name, std::string_view params={}) |
This defines a static method inside a class for Squirrel with defined params. | |
template<typename Func > | |
void | DefSQAdvancedStaticMethod (Squirrel &engine, Func function_proc, std::string_view function_name) |
This defines a static method inside a class for Squirrel, which has access to the 'engine' (experts only!). | |
template<typename Var > | |
void | DefSQConst (Squirrel &engine, Var value, std::string_view var_name) |
void | PreRegister (Squirrel &engine) |
void | PreRegister (Squirrel &engine, std::string_view parent_class) |
template<typename Func > | |
void | AddConstructor (Squirrel &engine, std::string_view params) |
void | AddSQAdvancedConstructor (Squirrel &engine) |
void | PostRegister (Squirrel &engine) |
Private Attributes | |
std::string_view | classname |
The template to define classes in Squirrel.
It takes care of the creation and calling of such classes, to minimize the API layer.
Definition at line 20 of file squirrel_class.hpp.
|
inline |
Definition at line 25 of file squirrel_class.hpp.
|
inline |
Definition at line 92 of file squirrel_class.hpp.
|
inline |
Definition at line 98 of file squirrel_class.hpp.
|
inline |
This defines a method inside a class for Squirrel, which has access to the 'engine' (experts only!).
Definition at line 46 of file squirrel_class.hpp.
References Squirrel::AddMethod().
Referenced by AIInfo::RegisterAPI(), and GameInfo::RegisterAPI().
|
inline |
This defines a static method inside a class for Squirrel, which has access to the 'engine' (experts only!).
Definition at line 69 of file squirrel_class.hpp.
References Squirrel::AddMethod().
|
inline |
Definition at line 76 of file squirrel_class.hpp.
|
inline |
This defines a method inside a class for Squirrel with defined params.
Definition at line 36 of file squirrel_class.hpp.
|
inline |
This defines a static method inside a class for Squirrel with defined params.
Definition at line 59 of file squirrel_class.hpp.
|
inline |
Definition at line 104 of file squirrel_class.hpp.
|
inline |
Definition at line 81 of file squirrel_class.hpp.
|
inline |
Definition at line 86 of file squirrel_class.hpp.
|
private |
Definition at line 22 of file squirrel_class.hpp.