root/trunk/src/arcemu-world/MapCell.h @ 3131

Revision 3131, 2.5 kB (checked in by Hypersniper, 8 months ago)

* APPLIED:
- Alterac Valley patch by Artox
- Copyrights patch by Terrorblade
- Earth shield patch by Jackpoz
- Energize patch by Arch1s
- Opcode fix by Sadikum
- Optional config fix by Psychobandit
- Various spells by Catti
- Various spells by Mesox/Ogchaos
- "Summon Myzrael" fix by this_is_junk
- "Torgos" fix by dzjhenghiz
- Worldstates patch by eggnrice
Good work community!

  • Property svn:eol-style set to native
  • Property ff set to
    *.cpp = svn:eol-style=native
    Makefile = svn:eol-style=native
    README = svn:eol-style=native
    CHANGELOG = svn:eol-style=native
    LICENSE = svn:eol-style=native
  • Property svn:keywords set to Date Author Rev
Line 
1/*
2 * ArcEmu MMORPG Server
3 * Copyright (C) 2005-2007 Ascent Team <http://www.ascentemu.com/>
4 * Copyright (C) 2008-2010 <http://www.ArcEmu.org/>
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU Affero General Public License for more details.
15 *
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21//
22// MapCell.h
23//
24
25#ifndef __MAP_CELL_H
26#define __MAP_CELL_H
27
28class Map;
29
30#define MAKE_CELL_EVENT(x,y) ( ((x) * 1000) + 200 + y )
31#define DECODE_CELL_EVENT(dest_x, dest_y, ev) (dest_x) = ((ev-200)/1000); (dest_y) = ((ev-200)%1000);
32
33class SERVER_DECL MapCell
34{
35        friend class MapMgr;
36public:
37        MapCell() {};
38        ~MapCell();
39
40        typedef std::set<Object*> ObjectSet;
41
42        //Init
43        void Init(uint32 x, uint32 y, uint32 mapid, MapMgr *mapmgr);
44       
45        //Object Managing
46        void AddObject(Object *obj); 
47        void RemoveObject(Object *obj);
48        bool HasObject(Object *obj) { return (_objects.find(obj) != _objects.end()); }
49        bool HasPlayers() { return ((_playerCount > 0) ? true : false); }
50        ARCEMU_INLINE size_t GetObjectCount() { return _objects.size(); }
51        void RemoveObjects();
52        ARCEMU_INLINE ObjectSet::iterator Begin() { return _objects.begin(); }
53        ARCEMU_INLINE ObjectSet::iterator End() { return _objects.end(); }
54
55        //State Related
56        void SetActivity(bool state);
57
58        ARCEMU_INLINE bool IsActive() { return _active; }
59        ARCEMU_INLINE bool IsLoaded() { return _loaded; }
60        ARCEMU_INLINE void SetLoaded( bool Loaded = true ) { _loaded = Loaded; }
61
62        //Object Loading Managing
63        void LoadObjects(CellSpawns * sp);
64        ARCEMU_INLINE uint32 GetPlayerCount() { return _playerCount; }
65
66        ARCEMU_INLINE bool IsUnloadPending() { return _unloadpending; }
67        ARCEMU_INLINE void SetUnloadPending(bool up) { _unloadpending = up; }
68        void QueueUnloadPending();
69        void CancelPendingUnload();
70        void Unload();
71        ARCEMU_INLINE uint16 GetPositionX() { return _x; }
72        ARCEMU_INLINE uint16 GetPositionY() { return _y; }
73
74        ObjectSet _respawnObjects;
75
76private:
77        uint16 _x,_y;
78        ObjectSet _objects;
79        bool _active, _loaded;
80        bool _unloadpending;
81
82        uint16 _playerCount;
83        MapMgr* _mapmgr;
84
85        Mutex m_objectlock;
86};
87
88#endif
Note: See TracBrowser for help on using the browser.