diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 6864ea32e..f578d7295 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -48,7 +48,6 @@ set(client_SRCS set(client_HEADERS CSoundBase.h - FunctionList.h gui/SDL_Pixels.h ) diff --git a/client/CPlayerInterface.h b/client/CPlayerInterface.h index 97921400d..91bec233a 100644 --- a/client/CPlayerInterface.h +++ b/client/CPlayerInterface.h @@ -2,7 +2,7 @@ #include "../lib/CondSh.h" -#include "FunctionList.h" +#include "../lib/FunctionList.h" #include "../lib/CGameInterface.h" #include "gui/CIntObject.h" #include "../lib/CGameState.h" diff --git a/client/CPreGame.h b/client/CPreGame.h index b2c154ef5..8d413e587 100644 --- a/client/CPreGame.h +++ b/client/CPreGame.h @@ -4,7 +4,7 @@ #include #include "../lib/StartInfo.h" #include "GUIClasses.h" -#include "FunctionList.h" +#include "../lib/FunctionList.h" #include "../lib/mapping/CMapInfo.h" #include "../lib/rmg/CMapGenerator.h" diff --git a/client/GUIClasses.h b/client/GUIClasses.h index 105035869..dafb84188 100644 --- a/client/GUIClasses.h +++ b/client/GUIClasses.h @@ -1,7 +1,7 @@ #pragma once #include "CAnimation.h" -#include "FunctionList.h" +#include "../lib/FunctionList.h" #include "../lib/ResourceSet.h" #include "../lib/CConfigHandler.h" #include "../lib/GameConstants.h" diff --git a/client/VCMI_client.vcxproj b/client/VCMI_client.vcxproj index 917f52154..5421bf5c6 100644 --- a/client/VCMI_client.vcxproj +++ b/client/VCMI_client.vcxproj @@ -231,7 +231,6 @@ - @@ -261,4 +260,4 @@ - \ No newline at end of file + diff --git a/client/VCMI_client.vcxproj.filters b/client/VCMI_client.vcxproj.filters index cc74f7c8c..3e0d2dc63 100644 --- a/client/VCMI_client.vcxproj.filters +++ b/client/VCMI_client.vcxproj.filters @@ -60,7 +60,6 @@ - @@ -93,4 +92,4 @@ - \ No newline at end of file + diff --git a/client/battle/CCreatureAnimation.h b/client/battle/CCreatureAnimation.h index 46c65ab5a..bae803d51 100644 --- a/client/battle/CCreatureAnimation.h +++ b/client/battle/CCreatureAnimation.h @@ -1,6 +1,6 @@ #pragma once -#include "../FunctionList.h" +#include "../../lib/FunctionList.h" //#include "../CDefHandler.h" #include "../CAnimation.h" diff --git a/client/gui/CIntObjectClasses.h b/client/gui/CIntObjectClasses.h index c52d19362..811b869ab 100644 --- a/client/gui/CIntObjectClasses.h +++ b/client/gui/CIntObjectClasses.h @@ -2,7 +2,7 @@ #include "CIntObject.h" #include "SDL_Extensions.h" -#include "../FunctionList.h" +#include "../../lib/FunctionList.h" struct SDL_Surface; struct Rect; diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index f958c5dba..65afa57d8 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -73,8 +73,10 @@ set(lib_SRCS set(lib_HEADERS ../Global.h + filesystem/CInputStream.h filesystem/ISimpleResourceLoader.h + AI_Base.h CondSh.h ConstTransitivePtr.h @@ -82,6 +84,7 @@ set(lib_HEADERS CRandomGenerator.h CScriptingModule.h CStopWatch.h + FunctionList.h GameConstants.h StringConstants.h IGameEventsReceiver.h diff --git a/client/FunctionList.h b/lib/FunctionList.h similarity index 95% rename from client/FunctionList.h rename to lib/FunctionList.h index db4b8c462..0710172e2 100644 --- a/client/FunctionList.h +++ b/lib/FunctionList.h @@ -1,85 +1,85 @@ -#pragma once - - -/* - * FunctionList.h, part of VCMI engine - * - * Authors: listed in file AUTHORS in main folder - * - * License: GNU General Public License v2.0 or later - * Full text of license available in license.txt file, in main folder - * - */ - -/// List of functions that share the same signature - can be used to call all of them easily -template -class CFunctionList -{ -public: - std::vector > funcs; - - CFunctionList(int){}; - CFunctionList(){}; - template - CFunctionList(const Functor &f) - { - funcs.push_back(boost::function(f)); - } - CFunctionList(const boost::function &first) - { - if (first) - funcs.push_back(first); - } - CFunctionList(std::nullptr_t) - {} - CFunctionList & operator+=(const boost::function &first) - { - funcs.push_back(first); - return *this; - } - void add(const CFunctionList &first) - { - for (size_t i = 0; i < first.funcs.size(); i++) - { - funcs.push_back(first.funcs[i]); - } - } - void clear() - { - funcs.clear(); - } - operator bool() const - { - return funcs.size(); - } - void operator()() const - { - std::vector > funcs2 = funcs; //backup - for(size_t i=0;i - void operator()(const Arg & a) const - { - std::vector > funcs2 = funcs; //backup - for(int i=0;i - void operator()(Arg1 & a, Arg2 & b) const - { - std::vector > funcs2 = funcs; //backup - for(int i=0;i +class CFunctionList +{ +public: + std::vector > funcs; + + CFunctionList(int){}; + CFunctionList(){}; + template + CFunctionList(const Functor &f) + { + funcs.push_back(boost::function(f)); + } + CFunctionList(const boost::function &first) + { + if (first) + funcs.push_back(first); + } + CFunctionList(std::nullptr_t) + {} + CFunctionList & operator+=(const boost::function &first) + { + funcs.push_back(first); + return *this; + } + void add(const CFunctionList &first) + { + for (size_t i = 0; i < first.funcs.size(); i++) + { + funcs.push_back(first.funcs[i]); + } + } + void clear() + { + funcs.clear(); + } + operator bool() const + { + return funcs.size(); + } + void operator()() const + { + std::vector > funcs2 = funcs; //backup + for(size_t i=0;i + void operator()(const Arg & a) const + { + std::vector > funcs2 = funcs; //backup + for(int i=0;i + void operator()(Arg1 & a, Arg2 & b) const + { + std::vector > funcs2 = funcs; //backup + for(int i=0;i + @@ -308,4 +309,4 @@ - \ No newline at end of file + diff --git a/lib/VCMI_lib.vcxproj.filters b/lib/VCMI_lib.vcxproj.filters index b46b0737c..f09bc0ea1 100644 --- a/lib/VCMI_lib.vcxproj.filters +++ b/lib/VCMI_lib.vcxproj.filters @@ -231,6 +231,9 @@ Header Files + + Header Files + Header Files @@ -316,4 +319,4 @@ RMG - \ No newline at end of file + diff --git a/server/CGameHandler.h b/server/CGameHandler.h index fedd669b6..70a388ad7 100644 --- a/server/CGameHandler.h +++ b/server/CGameHandler.h @@ -1,7 +1,7 @@ #pragma once -#include "../client/FunctionList.h" +#include "../lib/FunctionList.h" #include "../lib/CGameState.h" #include "../lib/Connection.h" #include "../lib/IGameCallback.h"