diff --git a/src/framework/Dynamic/ObjectRegistry.h b/src/framework/Dynamic/ObjectRegistry.h index 9e9121418..3cec26bbf 100644 --- a/src/framework/Dynamic/ObjectRegistry.h +++ b/src/framework/Dynamic/ObjectRegistry.h @@ -24,6 +24,7 @@ #include "Policies/Singleton.h" #include +#include #include /** ObjectRegistry holds all registry item of the same type diff --git a/src/game/CreatureAI.cpp b/src/game/CreatureAI.cpp index a66cc4278..e551dd004 100644 --- a/src/game/CreatureAI.cpp +++ b/src/game/CreatureAI.cpp @@ -17,10 +17,7 @@ */ #include "CreatureAI.h" -#include "HateMatrix.h" CreatureAI::~CreatureAI() { } - -uint32 HateBinder::si_noHateValue=0; diff --git a/src/game/HateMatrix.h b/src/game/HateMatrix.h deleted file mode 100644 index ab03e34c8..000000000 --- a/src/game/HateMatrix.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2005-2008 MaNGOS - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef MANGOS_HATEMATRIX_H -#define MANGOS_HATEMATRIX_H - -#include "Utilities/HashMap.h" -#include - -class Unit; - -struct MANGOS_DLL_DECL HateMatrix -{ - typedef hash_map HateMatrixMapType; - - inline uint32 operator[](Unit *unit) const - { - HateMatrixMapType::const_iterator iter = i_hateValues.find(unit); - return (iter == i_hateValues.end() ? 0 : iter->second); - } - - inline uint32& operator[](Unit *unit) - { - HateMatrixMapType::iterator iter = i_hateValues.find(unit); - if( iter == i_hateValues.end() ) - { - std::pair p = i_hateValues.insert( HateMatrixMapType::value_type(unit, 0) ); - assert(p.second); - iter = p.first; - } - - return iter->second; - } - - inline void ClearMatrix(void) { i_hateValues.clear(); } - - inline void RemoveValue(Unit *unit) - { - HateMatrixMapType::iterator iter = i_hateValues.find(unit); - if( iter != i_hateValues.end() ) - i_hateValues.erase( iter ); - } - - inline void AddValue(Unit *unit, uint32 val) - { - (*this)[unit] += val; - } - - private: - HateMatrixMapType i_hateValues; -}; - -struct HateBinder -{ - static uint32 si_noHateValue; - uint32 &i_hateValue; - Unit *i_unit; - HateBinder(uint32 &val, Unit *u) : i_hateValue(val), i_unit(u) {} - HateBinder() : i_hateValue(si_noHateValue), i_unit(NULL) {} - HateBinder(const HateBinder &obj) : i_hateValue(obj.i_hateValue), i_unit(obj.i_unit) {} - - HateBinder& operator=(const HateBinder &obj) - { - i_hateValue = obj.i_hateValue; - i_unit = obj.i_unit; - return *this; - } -}; -#endif diff --git a/src/game/Makefile.am b/src/game/Makefile.am index 6a1dc7225..03dbeef61 100644 --- a/src/game/Makefile.am +++ b/src/game/Makefile.am @@ -122,7 +122,6 @@ libmangosgame_a_SOURCES = \ Guild.cpp \ Guild.h \ GuildHandler.cpp \ - HateMatrix.h \ HomeMovementGenerator.cpp \ HomeMovementGenerator.h \ HostilRefManager.cpp \ diff --git a/win/VC71/game.vcproj b/win/VC71/game.vcproj index f51f1c076..d131d0f62 100644 --- a/win/VC71/game.vcproj +++ b/win/VC71/game.vcproj @@ -570,9 +570,6 @@ - - diff --git a/win/VC80/game.vcproj b/win/VC80/game.vcproj index 1d3886ce7..80aa58b04 100644 --- a/win/VC80/game.vcproj +++ b/win/VC80/game.vcproj @@ -934,10 +934,6 @@ RelativePath="..\..\src\game\Guild.h" > - - diff --git a/win/VC90/game.vcproj b/win/VC90/game.vcproj index c84b51832..19b0ae4ec 100644 --- a/win/VC90/game.vcproj +++ b/win/VC90/game.vcproj @@ -935,10 +935,6 @@ RelativePath="..\..\src\game\Guild.h" > - -