Lua: Counter module
Reply To cazfi
Add Counter module to Lua. Methods needed internally (minimum API to not break, e.g., savegames):
- Counter:rule_name()
- Counter:name_translation()
- find.counter(name)
- find.counter(id)
0001-OSDN-47827-Test.patch(1KB)
Sorry it took too long. I have many different things to do.
2023-06-23 01:32 Updated by: lachu
Sorry for previous mistake
- Place "find" functions to api_game_find.[ch], name functionality to api_game_methods.[ch]
- Add function headers
- Add LUASCRIPT_CHECK_...() to each function
- Add space between comma and the second parameter type:
+ const char *api_counter_rule_name @ rule_name (lua_State *L,Counter *c); + const char *api_counter_name_translation @ name_translation (lua_State *L,Counter *c);
Reply To cazfi
- Place "find" functions to api_game_find.[ch], name functionality to api_game_methods.[ch]
- Add function headers
- Add LUASCRIPT_CHECK_...() to each function
- Add space between comma and the second parameter type: {{{ + const char *api_counter_rule_name @ rule_name (lua_State *L,Counter *c); + const char *api_counter_name_translation @ name_translation (lua_State *L,Counter *c); }}}
It looks I must only add spaces between comma and parameter type in some places.
Reply To lachu
Reply To cazfi
- Place "find" functions to api_game_find.[ch], name functionality to api_game_methods.[ch]
You're still adding a new file for name functionality instead of adding it to api_game_methods.
- Add space between comma and the second parameter type: {{{ + const char *api_counter_rule_name @ rule_name (lua_State *L,Counter *c); + const char *api_counter_name_translation @ name_translation (lua_State *L,Counter *c); }}}
Still missing
0001-Add-comments-Move-routines-Add-checks.patch(8KB) Implementation 2.1 - Fix typo
Reply To cazfi
Reply To lachu
Reply To cazfi
- Place "find" functions to api_game_find.[ch], name functionality to api_game_methods.[ch]
You're still adding a new file for name functionality instead of adding it to api_game_methods.
- Add space between comma and the second parameter type: {{{ + const char *api_counter_rule_name @ rule_name (lua_State *L,Counter *c); + const char *api_counter_name_translation @ name_translation (lua_State *L,Counter *c); }}}
Still missing
0001-Add-comments-Move-routines-Add-checks.patch(8KB) Implementation 2.1 - Fix typo
There is also patch for test.
Add Counter module to Lua.
Methods needed internally (minimum API to not break, e.g., savegames):
- Counter:rule_name()
- Counter:name_translation()
- find.counter(name)
- find.counter(id)