Skip to content

Commit 55ccdcf

Browse files
authored
Update ForceScriptAPI.md
1 parent dc8a8ef commit 55ccdcf

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ForceScriptAPI.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -171,19 +171,19 @@ If a getter is set, but a setter is missing - then the script will return an err
171171

172172
The Lambda versions are very useful when wrapping game or engine state in a way that looks like normal member variable access.
173173
```
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 });
176176
```
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.
178178
Examples:
179179
```
180-
ScriptLambdaPropertyGet("string get_name()", (), std::string, { return s_level.name; });
180+
ScriptLambdaPropertyGet("string get_name()", std::string, { return s_level.name; });
181181
182-
ScriptLambdaPropertyGet("string get_slot()", (), std::string, { return s_level.slot; });
182+
ScriptLambdaPropertyGet("string get_slot()", std::string, { return s_level.slot; });
183183
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; });
185185
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; });
187187
```
188188
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:
189189
```

0 commit comments

Comments
 (0)