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:
Kayne Ruse
2015-01-11 19:08:31 +11:00
parent 8ea667a0b5
commit 051ed0f14c
10 changed files with 165 additions and 86 deletions
+10 -60
View File
@@ -23,64 +23,26 @@
#include "waypoint_data.hpp"
//TODO: return multiple values, dummy
//origin
static int setOriginX(lua_State* L) {
static int setOrigin(lua_State* L) {
//TODO
return 0;
}
static int setOriginY(lua_State* L) {
//TODO
return 0;
}
static int getOriginX(lua_State* L) {
//TODO
return 0;
}
static int getOriginY(lua_State* L) {
static int getOrigin(lua_State* L) {
//TODO
return 0;
}
//bounds
static int setBoundingBoxX(lua_State* L) {
static int setBoundingBox(lua_State* L) {
//TODO
return 0;
}
static int setBoundingBoxY(lua_State* L) {
//TODO
return 0;
}
static int setBoundingBoxW(lua_State* L) {
//TODO
return 0;
}
static int setBoundingBoxH(lua_State* L) {
//TODO
return 0;
}
static int getBoundingBoxX(lua_State* L) {
//TODO
return 0;
}
static int getBoundingBoxY(lua_State* L) {
//TODO
return 0;
}
static int getBoundingBoxW(lua_State* L) {
//TODO
return 0;
}
static int getBoundingBoxH(lua_State* L) {
static int getBoundingBox(lua_State* L) {
//TODO
return 0;
}
@@ -97,24 +59,12 @@ static int getTriggerReference(lua_State* L) {
}
static const luaL_Reg waypointLib[] = {
//origin
{"SetOriginX",setOriginX},
{"SetOriginY",setOriginY},
{"GetOriginX",getOriginX},
{"GetOriginY",getOriginY},
{"SetOrigin",setOrigin},
{"GetOrigin",getOrigin},
//bounds
{"SetBoundsX",setBoundingBoxX},
{"SetBoundsY",setBoundingBoxY},
{"SetBoundsW",setBoundingBoxW},
{"SetBoundsH",setBoundingBoxH},
{"SetBounds",setBoundingBox},
{"GetBounds",getBoundingBox},
{"GetBoundsX",getBoundingBoxX},
{"GetBoundsY",getBoundingBoxY},
{"GetBoundsW",getBoundingBoxW},
{"GetBoundsH",getBoundingBoxH},
//triggers
{"SetTrigger",setTriggerReference},
{"GetTrigger",getTriggerReference},
{nullptr, nullptr}