Replaced door system with waypoint system
This commit is contained in:
+3
-3
@@ -26,10 +26,10 @@
|
|||||||
#include "character_manager.hpp"
|
#include "character_manager.hpp"
|
||||||
#include "client_manager.hpp"
|
#include "client_manager.hpp"
|
||||||
#include "config_utility.hpp"
|
#include "config_utility.hpp"
|
||||||
#include "door_manager.hpp"
|
|
||||||
#include "monster_manager.hpp"
|
#include "monster_manager.hpp"
|
||||||
#include "room_manager.hpp"
|
#include "room_manager.hpp"
|
||||||
#include "udp_network_utility.hpp"
|
#include "udp_network_utility.hpp"
|
||||||
|
#include "waypoint_manager.hpp"
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -43,10 +43,10 @@ int main(int argc, char* argv[]) {
|
|||||||
CharacterManager::CreateSingleton();
|
CharacterManager::CreateSingleton();
|
||||||
ClientManager::CreateSingleton();
|
ClientManager::CreateSingleton();
|
||||||
ConfigUtility::CreateSingleton();
|
ConfigUtility::CreateSingleton();
|
||||||
DoorManager::CreateSingleton();
|
|
||||||
MonsterManager::CreateSingleton();
|
MonsterManager::CreateSingleton();
|
||||||
RoomManager::CreateSingleton();
|
RoomManager::CreateSingleton();
|
||||||
UDPNetworkUtility::CreateSingleton();
|
UDPNetworkUtility::CreateSingleton();
|
||||||
|
WaypointManager::CreateSingleton();
|
||||||
|
|
||||||
//call the server's routines
|
//call the server's routines
|
||||||
ServerApplication::CreateSingleton();
|
ServerApplication::CreateSingleton();
|
||||||
@@ -63,10 +63,10 @@ int main(int argc, char* argv[]) {
|
|||||||
CharacterManager::DeleteSingleton();
|
CharacterManager::DeleteSingleton();
|
||||||
ClientManager::DeleteSingleton();
|
ClientManager::DeleteSingleton();
|
||||||
ConfigUtility::DeleteSingleton();
|
ConfigUtility::DeleteSingleton();
|
||||||
DoorManager::DeleteSingleton();
|
|
||||||
MonsterManager::DeleteSingleton();
|
MonsterManager::DeleteSingleton();
|
||||||
RoomManager::DeleteSingleton();
|
RoomManager::DeleteSingleton();
|
||||||
UDPNetworkUtility::DeleteSingleton();
|
UDPNetworkUtility::DeleteSingleton();
|
||||||
|
WaypointManager::DeleteSingleton();
|
||||||
}
|
}
|
||||||
catch(exception& e) {
|
catch(exception& e) {
|
||||||
cerr << "Fatal exception thrown: " << e.what() << endl;
|
cerr << "Fatal exception thrown: " << e.what() << endl;
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
#include directories
|
#include directories
|
||||||
INCLUDES+=. accounts characters clients doors entities monsters rooms server_utilities ../common/debugging ../common/gameplay ../common/map ../common/network ../common/network/packet_types ../common/utilities
|
INCLUDES+=. accounts characters clients entities monsters rooms server_utilities waypoints ../common/debugging ../common/gameplay ../common/map ../common/network ../common/network/packet_types ../common/utilities
|
||||||
|
|
||||||
#libraries
|
#libraries
|
||||||
#the order of the $(LIBS) is important, at least for MinGW
|
#the order of the $(LIBS) is important, at least for MinGW
|
||||||
@@ -28,11 +28,11 @@ all: $(OBJ) $(OUT)
|
|||||||
$(MAKE) -C accounts
|
$(MAKE) -C accounts
|
||||||
$(MAKE) -C characters
|
$(MAKE) -C characters
|
||||||
$(MAKE) -C clients
|
$(MAKE) -C clients
|
||||||
$(MAKE) -C doors
|
|
||||||
$(MAKE) -C entities
|
$(MAKE) -C entities
|
||||||
$(MAKE) -C monsters
|
$(MAKE) -C monsters
|
||||||
$(MAKE) -C rooms
|
$(MAKE) -C rooms
|
||||||
$(MAKE) -C server_utilities
|
$(MAKE) -C server_utilities
|
||||||
|
$(MAKE) -C waypoints
|
||||||
$(CXX) $(CXXFLAGS) -o $(OUT) $(OBJ) $(LIBS)
|
$(CXX) $(CXXFLAGS) -o $(OUT) $(OBJ) $(LIBS)
|
||||||
|
|
||||||
$(OBJ): | $(OBJDIR)
|
$(OBJ): | $(OBJDIR)
|
||||||
|
|||||||
@@ -26,9 +26,9 @@
|
|||||||
#include "account_manager.hpp"
|
#include "account_manager.hpp"
|
||||||
#include "character_manager.hpp"
|
#include "character_manager.hpp"
|
||||||
#include "client_manager.hpp"
|
#include "client_manager.hpp"
|
||||||
#include "door_manager.hpp"
|
|
||||||
#include "monster_manager.hpp"
|
#include "monster_manager.hpp"
|
||||||
#include "room_manager.hpp"
|
#include "room_manager.hpp"
|
||||||
|
#include "waypoint_manager.hpp"
|
||||||
|
|
||||||
//utilities
|
//utilities
|
||||||
#include "config_utility.hpp"
|
#include "config_utility.hpp"
|
||||||
@@ -123,9 +123,9 @@ private:
|
|||||||
AccountManager& accountMgr = AccountManager::GetSingleton();
|
AccountManager& accountMgr = AccountManager::GetSingleton();
|
||||||
CharacterManager& characterMgr = CharacterManager::GetSingleton();
|
CharacterManager& characterMgr = CharacterManager::GetSingleton();
|
||||||
ClientManager& clientMgr = ClientManager::GetSingleton();
|
ClientManager& clientMgr = ClientManager::GetSingleton();
|
||||||
DoorManager& doorMgr = DoorManager::GetSingleton();
|
|
||||||
MonsterManager& monsterMgr = MonsterManager::GetSingleton();
|
MonsterManager& monsterMgr = MonsterManager::GetSingleton();
|
||||||
RoomManager& roomMgr = RoomManager::GetSingleton();
|
RoomManager& roomMgr = RoomManager::GetSingleton();
|
||||||
|
WaypointManager& waypointMgr = WaypointManager::GetSingleton();
|
||||||
|
|
||||||
ConfigUtility& config = ConfigUtility::GetSingleton();
|
ConfigUtility& config = ConfigUtility::GetSingleton();
|
||||||
UDPNetworkUtility& network = UDPNetworkUtility::GetSingleton();
|
UDPNetworkUtility& network = UDPNetworkUtility::GetSingleton();
|
||||||
|
|||||||
@@ -201,9 +201,9 @@ void ServerApplication::Quit() {
|
|||||||
accountMgr.UnloadAll();
|
accountMgr.UnloadAll();
|
||||||
characterMgr.UnloadAll();
|
characterMgr.UnloadAll();
|
||||||
clientMgr.UnloadAll();
|
clientMgr.UnloadAll();
|
||||||
doorMgr.UnloadAll();
|
|
||||||
monsterMgr.UnloadAll();
|
monsterMgr.UnloadAll();
|
||||||
roomMgr.UnloadAll();
|
roomMgr.UnloadAll();
|
||||||
|
waypointMgr.UnloadAll();
|
||||||
|
|
||||||
//APIs
|
//APIs
|
||||||
lua_close(luaState);
|
lua_close(luaState);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#config
|
#config
|
||||||
INCLUDES+=. ../entities ../server_utilities ../../common/utilities
|
INCLUDES+=. ../server_utilities ../../common/utilities
|
||||||
LIBS+=
|
LIBS+=
|
||||||
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
||||||
|
|
||||||
@@ -19,31 +19,5 @@
|
|||||||
* 3. This notice may not be removed or altered from any source
|
* 3. This notice may not be removed or altered from any source
|
||||||
* distribution.
|
* distribution.
|
||||||
*/
|
*/
|
||||||
#ifndef DOORDATA_HPP_
|
#include "waypoint_data.hpp"
|
||||||
#define DOORDATA_HPP_
|
|
||||||
|
|
||||||
#include "entity.hpp"
|
|
||||||
#include "vector2.hpp"
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
class DoorData: public Entity {
|
|
||||||
public:
|
|
||||||
DoorData() = default;
|
|
||||||
~DoorData() = default;
|
|
||||||
|
|
||||||
//accessors & mutators
|
|
||||||
std::string SetRoomName(std::string);
|
|
||||||
Vector2 SetDestPosition(Vector2);
|
|
||||||
|
|
||||||
std::string GetRoomName();
|
|
||||||
Vector2 GetDestPosition();
|
|
||||||
|
|
||||||
private:
|
|
||||||
friend class DoorManager;
|
|
||||||
|
|
||||||
std::string roomName;
|
|
||||||
Vector2 destPosition;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -19,20 +19,18 @@
|
|||||||
* 3. This notice may not be removed or altered from any source
|
* 3. This notice may not be removed or altered from any source
|
||||||
* distribution.
|
* distribution.
|
||||||
*/
|
*/
|
||||||
#include "door_data.hpp"
|
#ifndef WAYPOINTDATA_HPP_
|
||||||
|
#define WAYPOINTDATA_HPP_
|
||||||
|
|
||||||
std::string DoorData::SetRoomName(std::string s) {
|
#include <string>
|
||||||
return roomName = s;
|
|
||||||
}
|
|
||||||
|
|
||||||
Vector2 DoorData::SetDestPosition(Vector2 v) {
|
class WaypointData {
|
||||||
return destPosition = v;
|
public:
|
||||||
}
|
WaypointData() = default;
|
||||||
|
~WaypointData() = default;
|
||||||
|
|
||||||
std::string DoorData::GetRoomName() {
|
private:
|
||||||
return roomName;
|
friend class WaypointManager;
|
||||||
}
|
};
|
||||||
|
|
||||||
Vector2 DoorData::GetDestPosition() {
|
#endif
|
||||||
return destPosition;
|
|
||||||
}
|
|
||||||
@@ -19,48 +19,48 @@
|
|||||||
* 3. This notice may not be removed or altered from any source
|
* 3. This notice may not be removed or altered from any source
|
||||||
* distribution.
|
* distribution.
|
||||||
*/
|
*/
|
||||||
#include "door_manager.hpp"
|
#include "waypoint_manager.hpp"
|
||||||
|
|
||||||
int DoorManager::Create(std::string, Vector2) {
|
int WaypointManager::Create() {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoorManager::Load(std::string, Vector2) {
|
int WaypointManager::Load() {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoorManager::Save(int uid) {
|
int WaypointManager::Save(int uid) {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoorManager::Unload(int uid) {
|
void WaypointManager::Unload(int uid) {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoorManager::Delete(int uid) {
|
void WaypointManager::Delete(int uid) {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoorManager::UnloadAll() {
|
void WaypointManager::UnloadAll() {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoorManager::UnloadIf(std::function<bool(std::pair<const int, DoorData>)> fn) {
|
void WaypointManager::UnloadIf(std::function<bool(std::pair<const int, WaypointData>)> fn) {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
DoorData* DoorManager::Get(int uid) {
|
WaypointData* WaypointManager::Get(int uid) {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoorManager::GetLoadedCount() {
|
int WaypointManager::GetLoadedCount() {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoorManager::GetTotalCount() {
|
int WaypointManager::GetTotalCount() {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<int, DoorData>* DoorManager::GetContainer() {
|
std::map<int, WaypointData>* WaypointManager::GetContainer() {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
@@ -19,10 +19,10 @@
|
|||||||
* 3. This notice may not be removed or altered from any source
|
* 3. This notice may not be removed or altered from any source
|
||||||
* distribution.
|
* distribution.
|
||||||
*/
|
*/
|
||||||
#ifndef DOORMANAGER_HPP_
|
#ifndef WAYPOINTMANAGER_HPP_
|
||||||
#define DOORMANAGER_HPP_
|
#define WAYPOINTMANAGER_HPP_
|
||||||
|
|
||||||
#include "door_data.hpp"
|
#include "waypoint_data.hpp"
|
||||||
#include "manager_interface.hpp"
|
#include "manager_interface.hpp"
|
||||||
#include "singleton.hpp"
|
#include "singleton.hpp"
|
||||||
#include "vector2.hpp"
|
#include "vector2.hpp"
|
||||||
@@ -30,32 +30,32 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
class DoorManager:
|
class WaypointManager:
|
||||||
public Singleton<DoorManager>,
|
public Singleton<WaypointManager>,
|
||||||
public ManagerInterface<DoorData, std::string, Vector2>
|
public ManagerInterface<WaypointData>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//common public methods
|
//common public methods
|
||||||
int Create(std::string, Vector2) override;
|
int Create() override;
|
||||||
int Load(std::string, Vector2) override;
|
int Load() override;
|
||||||
int Save(int uid) override;
|
int Save(int uid) override;
|
||||||
void Unload(int uid) override;
|
void Unload(int uid) override;
|
||||||
void Delete(int uid) override;
|
void Delete(int uid) override;
|
||||||
|
|
||||||
void UnloadAll() override;
|
void UnloadAll() override;
|
||||||
void UnloadIf(std::function<bool(std::pair<const int, DoorData>)> fn) override;
|
void UnloadIf(std::function<bool(std::pair<const int, WaypointData>)> fn) override;
|
||||||
|
|
||||||
//accessors & mutators
|
//accessors & mutators
|
||||||
DoorData* Get(int uid) override;
|
WaypointData* Get(int uid) override;
|
||||||
int GetLoadedCount() override;
|
int GetLoadedCount() override;
|
||||||
int GetTotalCount() override;
|
int GetTotalCount() override;
|
||||||
std::map<int, DoorData>* GetContainer() override;
|
std::map<int, WaypointData>* GetContainer() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend Singleton<DoorManager>;
|
friend Singleton<WaypointManager>;
|
||||||
|
|
||||||
DoorManager() = default;
|
WaypointManager() = default;
|
||||||
~DoorManager() = default;
|
~WaypointManager() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Reference in New Issue
Block a user