Wrote the WaypointManager API skeleton

This commit is contained in:
Kayne Ruse
2015-01-10 14:03:13 +11:00
parent b391dde089
commit 8ea667a0b5
3 changed files with 42 additions and 2 deletions
+19
View File
@@ -21,6 +21,25 @@
*/
#include "waypoint_manager.hpp"
WaypointManager::WaypointManager() {
//EMPTY
}
WaypointManager::~WaypointManager() {
UnloadAll();
}
int WaypointManager::Create() {
//implicitly creates the element
WaypointData& waypointData = elementMap[counter];
//no real values set
waypointData.origin = {0, 0};
waypointData.bounds = {0, 0, 0, 0};
return counter++;
}
int WaypointManager::Create(Vector2 origin, BoundingBox bounds) {
//implicitly creates the element
WaypointData& waypointData = elementMap[counter];
+3 -2
View File
@@ -34,10 +34,11 @@
class WaypointManager {
public:
WaypointManager() = default;
~WaypointManager() = default;
WaypointManager();
~WaypointManager();
//common public methods
int Create();
int Create(Vector2 origin, BoundingBox bounds);
void Unload(int uid);
+20
View File
@@ -23,7 +23,27 @@
#include "waypoint_manager.hpp"
static int create(lua_State* L) {
//TODO
}
static int unload(lua_State* L) {
//TODO
}
static int getWaypoint(lua_State* L) {
//TODO
}
static int getLoadedCount(lua_State* L) {
//TODO
}
static const luaL_Reg waypointManagerLib[] = {
{"Create",create},
{"Unload",unload},
{"GetWaypoint",getWaypoint},
{"GetCount",getLoadedCount},
{nullptr, nullptr}
};