2 * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef _HOSTILEREFMANAGER
20 #define _HOSTILEREFMANAGER
23 #include "Utilities/LinkedReference/RefManager.h"
27 class HostileReference
;
30 //=================================================
32 class HostileRefManager
: public RefManager
<Unit
, ThreatManager
>
37 explicit HostileRefManager(Unit
*pOwner
) { iOwner
= pOwner
; }
40 Unit
* getOwner() { return iOwner
; }
42 // send threat to all my hateres for the pVictim
43 // The pVictim is hated than by them as well
44 // use for buffs and healing threat functionality
45 void threatAssist(Unit
*pVictim
, float threat
, SpellEntry
const *threatSpell
= 0, bool pSingleTarget
=false);
47 void addThreatPercent(int32 pValue
);
49 // The references are not needed anymore
50 // tell the source to remove them from the list and free the mem
51 void deleteReferences();
53 // Remove specific faction references
54 void deleteReferencesForFaction(uint32 faction
);
56 HostileReference
* getFirst() { return ((HostileReference
* ) RefManager
<Unit
, ThreatManager
>::getFirst()); }
58 void updateThreatTables();
60 void setOnlineOfflineState(bool pIsOnline
);
62 // set state for one reference, defined by Unit
63 void setOnlineOfflineState(Unit
*pCreature
,bool pIsOnline
);
65 // delete one reference, defined by Unit
66 void deleteReference(Unit
*pCreature
);
68 //=================================================