@@ -171,19 +171,19 @@ If a getter is set, but a setter is missing - then the script will return an err
171
171
172
172
The Lambda versions are very useful when wrapping game or engine state in a way that looks like normal member variable access.
173
173
```
174
- ScriptLambdaPropertyGet(Declaration, (Argument List), Return Type, { function body });
175
- ScriptLambdaPropertySet(Declaration, (Argument List), Return Type, { function body });
174
+ ScriptLambdaPropertyGet(Declaration, Return Type, { function body });
175
+ ScriptLambdaPropertySet(Declaration, (Argument List), { function body });
176
176
```
177
- Otherwise the rules are exactly the same as Lambda member functions and member properties.
177
+ Otherwise, the rules are the same as Lambda member functions and member properties.
178
178
Examples:
179
179
```
180
- ScriptLambdaPropertyGet("string get_name()", (), std::string, { return s_level.name; });
180
+ ScriptLambdaPropertyGet("string get_name()", std::string, { return s_level.name; });
181
181
182
- ScriptLambdaPropertyGet("string get_slot()", (), std::string, { return s_level.slot; });
182
+ ScriptLambdaPropertyGet("string get_slot()", std::string, { return s_level.slot; });
183
183
184
- ScriptLambdaPropertySet("void set_name(const string &in)", (std::string& name), void, { s_level.name = name; });
184
+ ScriptLambdaPropertySet("void set_name(const string &in)", (std::string& name), { s_level.name = name; });
185
185
186
- ScriptLambdaPropertySet("void set_palette(const string &in)", (std::string& palette), void, { s_level.palette = palette; });
186
+ ScriptLambdaPropertySet("void set_palette(const string &in)", (std::string& palette), { s_level.palette = palette; });
187
187
```
188
188
Even though it is reading from and writing to state outside of the class, it will be accessed through the class just like member variables in the scripts:
189
189
```
0 commit comments