From d7196df7606213bbc2f336f48003eca7cfeda918 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Sun, 3 Apr 2016 02:44:09 +1100 Subject: [PATCH] Added some files for combat system --- server/combat/barrier_data.cpp | 23 ++++++++++++++++ server/combat/barrier_data.hpp | 31 ++++++++++++++++++++++ server/combat/barrier_manager.cpp | 23 ++++++++++++++++ server/combat/barrier_manager.hpp | 23 ++++++++++++++++ server/combat/combat_instance.cpp | 23 ++++++++++++++++ server/combat/combat_instance.hpp | 30 +++++++++++++++++++++ server/combat/combat_instance_manager.cpp | 23 ++++++++++++++++ server/combat/combat_instance_manager.hpp | 23 ++++++++++++++++ server/combat/makefile | 32 +++++++++++++++++++++++ server/makefile | 3 ++- 10 files changed, 233 insertions(+), 1 deletion(-) create mode 100644 server/combat/barrier_data.cpp create mode 100644 server/combat/barrier_data.hpp create mode 100644 server/combat/barrier_manager.cpp create mode 100644 server/combat/barrier_manager.hpp create mode 100644 server/combat/combat_instance.cpp create mode 100644 server/combat/combat_instance.hpp create mode 100644 server/combat/combat_instance_manager.cpp create mode 100644 server/combat/combat_instance_manager.hpp create mode 100644 server/combat/makefile diff --git a/server/combat/barrier_data.cpp b/server/combat/barrier_data.cpp new file mode 100644 index 0000000..5cf0c9c --- /dev/null +++ b/server/combat/barrier_data.cpp @@ -0,0 +1,23 @@ +/* Copyright: (c) Kayne Ruse 2013-2016 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#include "barrier_data.hpp" + diff --git a/server/combat/barrier_data.hpp b/server/combat/barrier_data.hpp new file mode 100644 index 0000000..7a95603 --- /dev/null +++ b/server/combat/barrier_data.hpp @@ -0,0 +1,31 @@ +/* Copyright: (c) Kayne Ruse 2013-2016 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#include "entity.hpp" + +class BarrierData: public Entity { +public: + BarrierData() = default; + ~BarrierData() = default; + +private: + // +}; \ No newline at end of file diff --git a/server/combat/barrier_manager.cpp b/server/combat/barrier_manager.cpp new file mode 100644 index 0000000..c292d2b --- /dev/null +++ b/server/combat/barrier_manager.cpp @@ -0,0 +1,23 @@ +/* Copyright: (c) Kayne Ruse 2013-2016 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#include "barrier_manager.hpp" + diff --git a/server/combat/barrier_manager.hpp b/server/combat/barrier_manager.hpp new file mode 100644 index 0000000..5cf0c9c --- /dev/null +++ b/server/combat/barrier_manager.hpp @@ -0,0 +1,23 @@ +/* Copyright: (c) Kayne Ruse 2013-2016 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#include "barrier_data.hpp" + diff --git a/server/combat/combat_instance.cpp b/server/combat/combat_instance.cpp new file mode 100644 index 0000000..ebcc6eb --- /dev/null +++ b/server/combat/combat_instance.cpp @@ -0,0 +1,23 @@ +/* Copyright: (c) Kayne Ruse 2013-2016 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#include "combat_instance.hpp" + diff --git a/server/combat/combat_instance.hpp b/server/combat/combat_instance.hpp new file mode 100644 index 0000000..2c1cb3c --- /dev/null +++ b/server/combat/combat_instance.hpp @@ -0,0 +1,30 @@ +/* Copyright: (c) Kayne Ruse 2013-2016 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ + +class CombatInstance { +public: + CombatInstance() = default; + ~CombatInstance() = default; + +private: + // +}; \ No newline at end of file diff --git a/server/combat/combat_instance_manager.cpp b/server/combat/combat_instance_manager.cpp new file mode 100644 index 0000000..67fd92c --- /dev/null +++ b/server/combat/combat_instance_manager.cpp @@ -0,0 +1,23 @@ +/* Copyright: (c) Kayne Ruse 2013-2016 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#include "combat_instance_manager.hpp" + diff --git a/server/combat/combat_instance_manager.hpp b/server/combat/combat_instance_manager.hpp new file mode 100644 index 0000000..ebcc6eb --- /dev/null +++ b/server/combat/combat_instance_manager.hpp @@ -0,0 +1,23 @@ +/* Copyright: (c) Kayne Ruse 2013-2016 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#include "combat_instance.hpp" + diff --git a/server/combat/makefile b/server/combat/makefile new file mode 100644 index 0000000..211a55a --- /dev/null +++ b/server/combat/makefile @@ -0,0 +1,32 @@ +#config +INCLUDES+=. .. ../entities ../../common/utilities +LIBS+= +CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES)) + +#source +CXXSRC=$(wildcard *.cpp) + +#objects +OBJDIR=obj +OBJ+=$(addprefix $(OBJDIR)/,$(CXXSRC:.cpp=.o)) + +#output +OUTDIR=.. +OUT=$(addprefix $(OUTDIR)/,server.a) + +#targets +all: $(OBJ) $(OUT) + ar -crs $(OUT) $(OBJ) + +$(OBJ): | $(OBJDIR) + +$(OUT): | $(OUTDIR) + +$(OBJDIR): + mkdir $(OBJDIR) + +$(OUTDIR): + mkdir $(OUTDIR) + +$(OBJDIR)/%.o: %.cpp + $(CXX) $(CXXFLAGS) -c -o $@ $< diff --git a/server/makefile b/server/makefile index 94b2ded..96b7fc8 100644 --- a/server/makefile +++ b/server/makefile @@ -1,5 +1,5 @@ #include directories -INCLUDES+=. accounts characters clients creatures entities rooms triggers ../common/debugging ../common/gameplay ../common/map ../common/network ../common/network/packet_types ../common/utilities +INCLUDES+=. accounts characters clients combat creatures entities rooms triggers ../common/debugging ../common/gameplay ../common/map ../common/network ../common/network/packet_types ../common/utilities #libraries #the order of the $(LIBS) is important, at least for MinGW @@ -32,6 +32,7 @@ all: $(OBJ) $(OUT) $(MAKE) -C accounts $(MAKE) -C characters $(MAKE) -C clients + $(MAKE) -C combat $(MAKE) -C creatures $(MAKE) -C entities $(MAKE) -C rooms