TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MapReference.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3  * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; either version 2 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef _MAPREFERENCE_H
20 #define _MAPREFERENCE_H
21 
22 #include "Reference.h"
23 #include "Map.h"
24 
25 class MapReference : public Reference<Map, Player>
26 {
27  protected:
28  void targetObjectBuildLink() override
29  {
30  // called from link()
33  }
34  void targetObjectDestroyLink() override
35  {
36  // called from unlink()
38  }
39  void sourceObjectDestroyLink() override
40  {
41  // called from invalidate()
43  }
44  public:
48  MapReference const* next() const { return (MapReference const*)Reference<Map, Player>::next(); }
51 };
52 #endif
53 
MapReference * next()
Definition: MapReference.h:47
void unlink()
Definition: Reference.h:61
MapReference * nockeck_prev()
Definition: MapReference.h:49
void sourceObjectDestroyLink() override
Definition: MapReference.h:39
void incSize()
Definition: LinkedList.h:137
void targetObjectDestroyLink() override
Definition: MapReference.h:34
~MapReference()
Definition: MapReference.h:46
void decSize()
Definition: LinkedList.h:138
Definition: Reference.h:27
MapReference const * next() const
Definition: MapReference.h:48
Reference< TO, FROM > * next()
Definition: Reference.h:83
Definition: Map.h:259
Reference< TO, FROM > * nocheck_prev()
Definition: Reference.h:90
void insertFirst(LinkedListElement *pElem)
Definition: LinkedList.h:110
MapReference()
Definition: MapReference.h:45
bool isValid() const
Definition: Reference.h:78
void targetObjectBuildLink() override
Definition: MapReference.h:28
MapRefManager m_mapRefManager
Definition: Map.h:647
MapReference const * nocheck_prev() const
Definition: MapReference.h:50
Map * getTarget() const
Definition: Reference.h:94
Definition: MapReference.h:25