[7297] Fixed profession spells sorting in trainer spell list at client.
[getmangos.git] / src / game / HostilRefManager.h
blob64f6988ccc2c0817b57eac1ac7ef7b97cca43c22
1 /*
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
22 #include "Common.h"
23 #include "Utilities/LinkedReference/RefManager.h"
25 class Unit;
26 class ThreatManager;
27 class HostilReference;
28 struct SpellEntry;
30 //=================================================
32 class HostilRefManager : public RefManager<Unit, ThreatManager>
34 private:
35 Unit *iOwner;
36 public:
37 explicit HostilRefManager(Unit *pOwner) { iOwner = pOwner; }
38 ~HostilRefManager();
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 //=================================================
66 #endif