From ae65d36bb4ecca988c5635f493b5f957b51c5870 Mon Sep 17 00:00:00 2001 From: XTZGZoReX Date: Wed, 18 Mar 2009 21:04:47 +0100 Subject: * Implemented new ObjectAccessor functions: GetCreatures, GetUnits, GetGameObjects, and GetWorldObjects. These can be used for loopong over objects in the world. * Note: GetWorldObjects is (probably) heavy and should be used very sparingly. Always use the function corresponding to the type of object you're looping over. --HG-- branch : trunk --- src/game/ObjectAccessor.h | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'src/game/ObjectAccessor.h') diff --git a/src/game/ObjectAccessor.h b/src/game/ObjectAccessor.h index fea2331695c..218d1d91995 100644 --- a/src/game/ObjectAccessor.h +++ b/src/game/ObjectAccessor.h @@ -154,9 +154,30 @@ class TRINITY_DLL_DECL ObjectAccessor : public Trinity::Singleton::MapType& GetPlayers() - { - return HashMapHolder::GetContainer(); + HashMapHolder::MapType& GetPlayers() + { + return HashMapHolder::GetContainer(); + } + + HashMapHolder::MapType& GetCreatures() + { + return HashMapHolder::GetContainer(); + } + + HashMapHolder::MapType& GetUnits() + { + return HashMapHolder::GetContainer(); + } + + HashMapHolder::MapType& GetGameObjects() + { + return HashMapHolder::GetContainer(); + } + + // note: possibly very heavy + HashMapHolder::MapType& GetWorldObjects() + { + return HashMapHolder::GetContainer(); } template void AddObject(T *object) -- cgit v1.2.3