From 92eb75af7eecc177a9114e4ef055bcd3d935f8fc Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Fri, 2 Jan 2015 23:51:00 +1100 Subject: [PATCH] Slight tweaks to waypoints --- server/waypoints/waypoint_data.cpp | 18 +++++++++++++++++- server/waypoints/waypoint_data.hpp | 13 +++++++++++-- server/waypoints/waypoint_manager.cpp | 12 ------------ server/waypoints/waypoint_manager.hpp | 3 --- 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/server/waypoints/waypoint_data.cpp b/server/waypoints/waypoint_data.cpp index b720e1d..3225834 100644 --- a/server/waypoints/waypoint_data.cpp +++ b/server/waypoints/waypoint_data.cpp @@ -27,4 +27,20 @@ int WaypointData::SetTriggerReference(int i) { int WaypointData::GetTriggerReference() { return triggerRef; -} \ No newline at end of file +} + +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; +} diff --git a/server/waypoints/waypoint_data.hpp b/server/waypoints/waypoint_data.hpp index 32aa7d0..f58555c 100644 --- a/server/waypoints/waypoint_data.hpp +++ b/server/waypoints/waypoint_data.hpp @@ -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 -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 \ No newline at end of file diff --git a/server/waypoints/waypoint_manager.cpp b/server/waypoints/waypoint_manager.cpp index a89165b..35101d1 100644 --- a/server/waypoints/waypoint_manager.cpp +++ b/server/waypoints/waypoint_manager.cpp @@ -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 } diff --git a/server/waypoints/waypoint_manager.hpp b/server/waypoints/waypoint_manager.hpp index 38aea9e..bd1cc34 100644 --- a/server/waypoints/waypoint_manager.hpp +++ b/server/waypoints/waypoint_manager.hpp @@ -41,10 +41,7 @@ class WaypointManager: public Singleton { 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)> fn);