[7921] Set pet and for creature owner in Spell::EffectSummon similar other summon...
[getmangos.git] / src / game / UpdateData.h
blobe31140e7da8745df9c4edf34358d6392f22c546f
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 __UPDATEDATA_H
20 #define __UPDATEDATA_H
22 class WorldPacket;
24 enum OBJECT_UPDATE_TYPE
26 UPDATETYPE_VALUES = 0,
27 UPDATETYPE_MOVEMENT = 1,
28 UPDATETYPE_CREATE_OBJECT = 2,
29 UPDATETYPE_CREATE_OBJECT2 = 3,
30 UPDATETYPE_OUT_OF_RANGE_OBJECTS = 4,
31 UPDATETYPE_NEAR_OBJECTS = 5
34 enum OBJECT_UPDATE_FLAGS
36 UPDATEFLAG_NONE = 0x0000,
37 UPDATEFLAG_SELF = 0x0001,
38 UPDATEFLAG_TRANSPORT = 0x0002,
39 UPDATEFLAG_HAS_TARGET = 0x0004,
40 UPDATEFLAG_LOWGUID = 0x0008,
41 UPDATEFLAG_HIGHGUID = 0x0010,
42 UPDATEFLAG_LIVING = 0x0020,
43 UPDATEFLAG_HAS_POSITION = 0x0040,
44 UPDATEFLAG_VEHICLE = 0x0080,
45 UPDATEFLAG_POSITION = 0x0100,
46 UPDATEFLAG_ROTATION = 0x0200
49 class UpdateData
51 public:
52 UpdateData();
54 void AddOutOfRangeGUID(std::set<uint64>& guids);
55 void AddOutOfRangeGUID(const uint64 &guid);
56 void AddUpdateBlock(const ByteBuffer &block);
57 bool BuildPacket(WorldPacket *packet);
58 bool HasData() { return m_blockCount > 0 || !m_outOfRangeGUIDs.empty(); }
59 void Clear();
61 std::set<uint64> const& GetOutOfRangeGUIDs() const { return m_outOfRangeGUIDs; }
63 protected:
64 uint32 m_blockCount;
65 std::set<uint64> m_outOfRangeGUIDs;
66 ByteBuffer m_data;
68 void Compress(void* dst, uint32 *dst_size, void* src, int src_size);
70 #endif