root/trunk/src/game/MapRefManager.h @ 268

Revision 257, 1.9 kB (checked in by yumileroy, 17 years ago)

*Merge from Mangos. Add MapReference?. Author: hunuza.
*Also re-commit the patches reverted in 255.

Original author: megamage
Date: 2008-11-18 19:40:06-06:00

Line 
1/*
2 * Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
3 *
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.
8 *
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.
13 *
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
17 */
18
19#ifndef _MAPREFMANAGER
20#define _MAPREFMANAGER
21
22#include "Utilities/LinkedReference/RefManager.h"
23
24class MapReference;
25
26class MapRefManager : public RefManager<Map, Player>
27{
28    public:
29        typedef LinkedListHead::Iterator< MapReference > iterator;
30        typedef LinkedListHead::Iterator< MapReference const > const_iterator;
31
32        MapReference* getFirst() { return (MapReference*)RefManager<Map, Player>::getFirst(); }
33        MapReference const* getFirst() const { return (MapReference const*)RefManager<Map, Player>::getFirst(); }
34        MapReference* getLast() { return (MapReference*)RefManager<Map, Player>::getLast(); }
35        MapReference const* getLast() const { return (MapReference const*)RefManager<Map, Player>::getLast(); }
36
37        iterator begin() { return iterator(getFirst()); }
38        iterator end() { return iterator(NULL); }
39        iterator rbegin() { return iterator(getLast()); }
40        iterator rend() { return iterator(NULL); }
41        const_iterator begin() const { return const_iterator(getFirst()); }
42        const_iterator end() const  { return const_iterator(getLast()); }
43};
44#endif
Note: See TracBrowser for help on using the browser.