From bc96df1aae35d2a887ae58f85aeadf0049077b2b Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sun, 8 Apr 2012 17:40:05 +0200 Subject: 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. --- src/server/shared/Utilities/Util.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/server/shared/Utilities/Util.h') 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 #include @@ -653,12 +653,4 @@ public: }; }; -/* Select a random element from a container. Note: make sure you explicitly empty check the container */ -template 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 -- cgit v1.2.3