![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include <cstring>#include "lauxlib.h"#include "lua.h"#include "lualib.h"#include "log.h"#include "support.h"#include "events.h"#include "api_game_specenum.h"
Include dependency graph for api_game_specenum.cpp:Go to the source code of this file.
Macros | |
| #define | API_SPECENUM_INDEX_NAME(type) api_specenum_##type##_index |
| #define | API_SPECENUM_CREATE_TABLE(L, type, name) api_specenum_create_table((L), (name), API_SPECENUM_INDEX_NAME(type)) |
| #define | API_SPECENUM_DEFINE_INDEX(type_name, prefix) |
| Define a the __index (table, key) -> value metamethod Return the enum value whose name is the concatenation of prefix and key. More... | |
Functions | |
| static void | api_specenum_create_table (lua_State *L, const char *name, lua_CFunction findex) |
| Create a module table and set the member lookup function. More... | |
| int | api_specenum_open (lua_State *L) |
| Define the __index function for each exported specenum type. More... | |
| #define API_SPECENUM_CREATE_TABLE | ( | L, | |
| type, | |||
| name | |||
| ) | api_specenum_create_table((L), (name), API_SPECENUM_INDEX_NAME(type)) |
Definition at line 31 of file api_game_specenum.cpp.
| #define API_SPECENUM_DEFINE_INDEX | ( | type_name, | |
| prefix | |||
| ) |
Define a the __index (table, key) -> value metamethod Return the enum value whose name is the concatenation of prefix and key.
The fetched value is written back to the lua table, and further accesses will resolve there instead of this function.
Definition at line 40 of file api_game_specenum.cpp.
| #define API_SPECENUM_INDEX_NAME | ( | type | ) | api_specenum_##type##_index |
Definition at line 30 of file api_game_specenum.cpp.
|
static |
Create a module table and set the member lookup function.
Definition at line 65 of file api_game_specenum.cpp.
| int api_specenum_open | ( | lua_State * | L | ) |
Define the __index function for each exported specenum type.
Load the specenum modules into Lua state L.
Definition at line 94 of file api_game_specenum.cpp.
Referenced by script_client_init(), and script_server_init().