2 * Copyright (C) 2005-2009 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 HostilReference
;
30 //=================================================
32 class HostilRefManager
: public RefManager
<Unit
, ThreatManager
>
37 explicit HostilRefManager(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 HostilReference
* getFirst() { return ((HostilReference
* ) RefManager
<Unit
, ThreatManager
>::getFirst()); }
55 void updateThreatTables();
57 void setOnlineOfflineState(bool pIsOnline
);
59 // set state for one reference, defined by Unit
60 void setOnlineOfflineState(Unit
*pCreature
,bool pIsOnline
);
62 // delete one reference, defined by Unit
63 void deleteReference(Unit
*pCreature
);
65 //=================================================