Slight tweaks to waypoints

This commit is contained in:
Kayne Ruse
2015-01-02 23:51:00 +11:00
parent d815f17442
commit 92eb75af7e
4 changed files with 28 additions and 18 deletions
+16
View File
@@ -28,3 +28,19 @@ int WaypointData::SetTriggerReference(int i) {
int WaypointData::GetTriggerReference() {
return triggerRef;
}
BoundingBox WaypointData::SetBoundingBox(BoundingBox b) {
return bounds = b;
}
BoundingBox WaypointData::GetBoundingBox() {
return bounds;
}
Vector2 WaypointData::SetOrigin(Vector2 v) {
return origin = v;
}
Vector2 WaypointData::GetOrigin() {
return origin;
}
+11 -2
View File
@@ -22,7 +22,8 @@
#ifndef WAYPOINTDATA_HPP_
#define WAYPOINTDATA_HPP_
#include "entity.hpp"
#include "bounding_box.hpp"
#include "vector2.hpp"
#if defined(__MINGW32__)
#include "lua/lua.hpp"
@@ -32,7 +33,7 @@
#include <string>
class WaypointData: public Entity {
class WaypointData {
public:
WaypointData() = default;
~WaypointData() = default;
@@ -40,10 +41,18 @@ public:
int SetTriggerReference(int i);
int GetTriggerReference();
BoundingBox SetBoundingBox(BoundingBox b);
BoundingBox GetBoundingBox();
Vector2 SetOrigin(Vector2 v);
Vector2 GetOrigin();
private:
friend class WaypointManager;
int triggerRef = LUA_NOREF;
BoundingBox bounds;
Vector2 origin;
};
#endif
-12
View File
@@ -25,22 +25,10 @@ int WaypointManager::Create() {
//TODO
}
int WaypointManager::Load() {
//TODO
}
int WaypointManager::Save(int uid) {
//TODO
}
void WaypointManager::Unload(int uid) {
//TODO
}
void WaypointManager::Delete(int uid) {
//TODO
}
void WaypointManager::UnloadAll() {
//TODO
}
-3
View File
@@ -41,10 +41,7 @@ class WaypointManager: public Singleton<WaypointManager> {
public:
//common public methods
int Create();
int Load();
int Save(int uid);
void Unload(int uid);
void Delete(int uid);
void UnloadAll();
void UnloadIf(std::function<bool(std::pair<const int, WaypointData const&>)> fn);