Changed the naming conventions (read more)

I've changed some naming concentions in the lua APIs. I've also made a few
other tweaks, like region_pager_api.cpp delegating to the passed
RegionPager object. This won't explicitly run, becuase there's still a few
more changes needed.
This commit is contained in:
Kayne Ruse
2014-06-23 03:45:30 +10:00
parent e19b6fbc23
commit 64baa63d12
12 changed files with 98 additions and 133 deletions
+7 -7
View File
@@ -37,7 +37,7 @@
#include "lua/lua.hpp"
#include "region_api.hpp"
#include "pager_api.hpp"
#include "region_pager_api.hpp"
#include "room_api.hpp"
#include "room_mgr_api.hpp"
#include "generator_api.hpp"
@@ -56,12 +56,12 @@ static const luaL_Reg loadedlibs[] = {
{LUA_MATHLIBNAME, luaopen_math},
{LUA_DBLIBNAME, luaopen_debug},
//custom libs
{LUA_REGIONLIBNAME, luaopen_regionapi},
{LUA_PAGERLIBNAME, luaopen_pagerapi},
{LUA_ROOMLIBNAME, luaopen_roomapi},
{LUA_ROOMMGRLIBNAME, luaopen_roommgrapi},
{LUA_GENERATORLIBNAME, luaopen_generatorapi},
//Tortuga's API
{TORTUGA_REGION_NAME, openRegionAPI},
{TORTUGA_REGION_PAGER_NAME, openRegionPagerAPI},
{TORTUGA_ROOM_NAME, openRoomAPI},
{TORTUGA_ROOM_MGR_NAME, openRoomMgrAPI},
{TORTUGA_GENRATOR_NAME, openGeneratorAPI},
{NULL, NULL}
};
+7 -7
View File
@@ -65,15 +65,15 @@ static int getMapHeight(lua_State* L) {
return 1;
}
static const luaL_Reg generatorlib[] = {
{"gettype", getMapType},
{"getchunk", getChunk},
{"getmapwidth", getMapWidth},
{"getmapheight", getMapHeight},
static const luaL_Reg generatorLib[] = {
{"GetMapType", getMapType},
{"GetChunk", getChunk},
{"GetMapWidth", getMapWidth},
{"GetMapHeight", getMapHeight},
{nullptr, nullptr}
};
LUAMOD_API int luaopen_generatorapi(lua_State* L) {
luaL_newlib(L, generatorlib);
LUAMOD_API int openGeneratorAPI(lua_State* L) {
luaL_newlib(L, generatorLib);
return 1;
}
+2 -3
View File
@@ -24,8 +24,7 @@
#include "lua/lua.hpp"
#define LUA_GENERATORLIBNAME "generator"
LUAMOD_API int luaopen_generatorapi(lua_State* L);
#define TORTUGA_GENRATOR_NAME "Generator"
LUAMOD_API int openGeneratorAPI(lua_State* L);
#endif
+17 -5
View File
@@ -35,15 +35,27 @@ static int getGenerator(lua_State* L) {
return 1;
}
static int onCreate(lua_State* L) {
//TODO: onCreate()
return 0;
}
static int onUnload(lua_State* L) {
//TODO: onUnload()
return 0;
}
//TODO: parameters
static const luaL_Reg roomlib[] = {
{"getpager",getPager},
{"getgenerator",getGenerator},
static const luaL_Reg roomLib[] = {
{"GetPager",getPager},
{"GetGenerator",getGenerator},
{"OnCreate", onCreate},
{"OnUnload", onUnload},
{nullptr, nullptr}
};
LUAMOD_API int luaopen_roomapi(lua_State* L) {
luaL_newlib(L, roomlib);
LUAMOD_API int openRoomAPI(lua_State* L) {
luaL_newlib(L, roomLib);
return 1;
}
+2 -2
View File
@@ -24,7 +24,7 @@
#include "lua/lua.hpp"
#define LUA_ROOMLIBNAME "room"
LUAMOD_API int luaopen_roomapi(lua_State* L);
#define TORTUGA_ROOM_NAME "Room"
LUAMOD_API int openRoomAPI(lua_State* L);
#endif
+6 -6
View File
@@ -73,14 +73,14 @@ static int unloadRoom(lua_State* L) {
return 0;
}
static const luaL_Reg roommgrlib[] = {
{"getroom",getRoom},
{"createroom",createRoom},
{"unloadroom",unloadRoom},
static const luaL_Reg roomMgrLib[] = {
{"GetRoom",getRoom},
{"CreateRoom",createRoom},
{"UnloadRoom",unloadRoom},
{nullptr, nullptr}
};
LUAMOD_API int luaopen_roommgrapi(lua_State* L) {
luaL_newlib(L, roommgrlib);
LUAMOD_API int openRoomMgrAPI(lua_State* L) {
luaL_newlib(L, roomMgrLib);
return 1;
}
+2 -2
View File
@@ -24,7 +24,7 @@
#include "lua/lua.hpp"
#define LUA_ROOMMGRLIBNAME "roommgr"
LUAMOD_API int luaopen_roommgrapi(lua_State* L);
#define TORTUGA_ROOM_MGR_NAME "RoomMgr"
LUAMOD_API int openRoomMgrAPI(lua_State* L);
#endif