TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
UpdateData.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 __UPDATEDATA_H
20 #define __UPDATEDATA_H
21 
22 #include "ByteBuffer.h"
23 #include "ObjectGuid.h"
24 #include <set>
25 
26 class WorldPacket;
27 
29 {
34 };
35 
37 {
38  UPDATEFLAG_NONE = 0x0000,
39  UPDATEFLAG_SELF = 0x0001,
48  //UPDATEFLAG_AREATRIGGER = 0x0200,
49  //UPDATEFLAG_GAMEOBJECT = 0x0400,
50  //UPDATEFLAG_REPLACE_ACTIVE = 0x0800,
51  //UPDATEFLAG_NO_BIRTH_ANIM = 0x1000,
52  //UPDATEFLAG_ENABLE_PORTALS = 0x2000,
53  //UPDATEFLAG_PLAY_HOVER_ANIM = 0x4000,
54  //UPDATEFLAG_IS_SUPPRESSING_GREETINGS = 0x8000
55  //UPDATEFLAG_SCENEOBJECT = 0x10000,
56  //UPDATEFLAG_SCENE_PENDING_INSTANCE = 0x20000
57 };
58 
60 {
61  public:
62  UpdateData(uint32 map);
65  m_data(std::move(right.m_data))
66  {
67  }
68 
69  void AddOutOfRangeGUID(GuidSet& guids);
70  void AddOutOfRangeGUID(ObjectGuid guid);
71  void AddUpdateBlock(const ByteBuffer &block);
72  bool BuildPacket(WorldPacket* packet);
73  bool HasData() const { return m_blockCount > 0 || !m_outOfRangeGUIDs.empty(); }
74  void Clear();
75 
76  GuidSet const& GetOutOfRangeGUIDs() const { return m_outOfRangeGUIDs; }
77 
78  protected:
83 
84  UpdateData(UpdateData const& right) = delete;
85  UpdateData& operator=(UpdateData const& right) = delete;
86 };
87 #endif
88 
uint32 m_map
Definition: UpdateData.h:79
GuidSet const & GetOutOfRangeGUIDs() const
Definition: UpdateData.h:76
Definition: UpdateData.h:38
Definition: UpdateData.h:39
Definition: UpdateData.h:32
Definition: ByteBuffer.h:70
Definition: UpdateData.h:33
Definition: UpdateData.h:46
STL namespace.
Definition: UpdateData.h:31
Definition: UpdateData.h:45
Definition: UpdateData.h:41
UpdateData(uint32 map)
Definition: UpdateData.cpp:25
Definition: UpdateData.h:47
Definition: UpdateData.h:59
OBJECT_UPDATE_TYPE
Definition: UpdateData.h:28
UpdateData & operator=(UpdateData const &right)=delete
void Clear()
Definition: UpdateData.cpp:65
UpdateData(UpdateData &&right)
Definition: UpdateData.h:63
uint32_t uint32
Definition: Define.h:150
Definition: UpdateData.h:44
Definition: UpdateData.h:40
Definition: UpdateData.h:42
void AddUpdateBlock(const ByteBuffer &block)
Definition: UpdateData.cpp:37
ByteBuffer m_data
Definition: UpdateData.h:82
void AddOutOfRangeGUID(GuidSet &guids)
Definition: UpdateData.cpp:27
std::set< ObjectGuid > GuidSet
Definition: ObjectGuid.h:332
bool HasData() const
Definition: UpdateData.h:73
OBJECT_UPDATE_FLAGS
Definition: UpdateData.h:36
uint32 m_blockCount
Definition: UpdateData.h:80
Definition: UpdateData.h:43
bool BuildPacket(WorldPacket *packet)
Definition: UpdateData.cpp:43
Definition: ObjectGuid.h:189
GuidSet m_outOfRangeGUIDs
Definition: UpdateData.h:81
Definition: UpdateData.h:30
Definition: WorldPacket.h:26