diff options
author | Machiavelli <machiavelli.trinity@gmail.com> | 2012-04-08 17:40:05 +0200 |
---|---|---|
committer | Machiavelli <machiavelli.trinity@gmail.com> | 2012-04-08 17:40:05 +0200 |
commit | bc96df1aae35d2a887ae58f85aeadf0049077b2b (patch) | |
tree | e7364e2bc0ce4f06d352136724263a6f06a4b4e2 /src/server/shared/Utilities/Util.h | |
parent | e636531da3603c10a9ebcb8a55d52d6cdb3a400a (diff) |
Core/Shared: Move container functions to shared project under Trinity::Container namespace. Also implement RandomResizeList which takes a predicate function as parameter.
Core/ScriptedAI: Extend SummonList::DoAction to take a predicate function as parameter and allow specifying a maximum number of units to be selected.
Diffstat (limited to 'src/server/shared/Utilities/Util.h')
-rwxr-xr-x | src/server/shared/Utilities/Util.h | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h index 4434ed36645..196882dc2a0 100755 --- a/src/server/shared/Utilities/Util.h +++ b/src/server/shared/Utilities/Util.h @@ -20,7 +20,7 @@ #define _UTIL_H #include "Common.h" - +#include "Containers.h" #include <string> #include <vector> @@ -653,12 +653,4 @@ public: }; }; -/* Select a random element from a container. Note: make sure you explicitly empty check the container */ -template <class C> typename C::value_type const& SelectRandomContainerElement(C const& container) -{ - typename C::const_iterator it = container.begin(); - std::advance(it, urand(0, container.size() - 1)); - return *it; -} - #endif |