Monster API clones from Entity API, read more
This is my solution for handling inheritance via lua. The Entity class is only a base class, so the entity API is designed to be copied from, rather than used directly. linit.c: It should be noted that the Entity API must always be placed before the utilizing child APIs. I don't know about how lua handles things internally, but I'm assuming that this is the case. There's no real meat in the API code yet, since that's just busy-work. Right now I feel beter about writing the connective tissue. This case could aslo extend to the waypoint and monster APIs. The waypoint system had some API and class methods removed for brevity.
This commit is contained in:
@@ -36,6 +36,9 @@
|
||||
|
||||
#include "lua.hpp"
|
||||
|
||||
#include "entity_api.hpp"
|
||||
#include "monster_system_api.hpp"
|
||||
|
||||
#include "map_system_api.hpp"
|
||||
#include "room_system_api.hpp"
|
||||
#include "waypoint_system_api.hpp"
|
||||
@@ -59,6 +62,8 @@ static const luaL_Reg loadedlibs[] = {
|
||||
|
||||
//these libs are preloaded and must be required before used
|
||||
static const luaL_Reg preloadedlibs[] = {
|
||||
{TORTUGA_ENTITY_API, openEntityAPI},
|
||||
{TORTUGA_MONSTER_SYSTEM_API, openMonsterSystemAPI},
|
||||
{TORTUGA_MAP_SYSTEM_API, openMapSystemAPI},
|
||||
{TORTUGA_ROOM_SYSTEM_API, openRoomSystemAPI},
|
||||
{TORTUGA_WAYPOINT_SYSTEM_API, openWaypointSystemAPI},
|
||||
|
||||
Reference in New Issue
Block a user