00001 /*************************************************************************** 00002 townarray.h 00003 ------------------- 00004 begin : 2005-01-16 00005 copyright : (C) 2005 by Dominik Haumann 00006 email : dhaumann@users.sourceforge.net 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 This program is free software; you can redistribute it and/or 00011 modify it under the terms of the GNU General Public License 00012 as published by the Free Software Foundation; either version 2 00013 of the License, or (at your option) any later version. 00014 00015 This program is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 GNU General Public License for more details. 00019 00020 You should have received a copy of the GNU General Public License 00021 along with this program; if not, write to the Free Software 00022 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00023 ***************************************************************************/ 00024 00025 #ifndef TOWNARRAY_H 00026 #define TOWNARRAY_H 00027 00028 #include "town.h" 00029 00030 namespace WDS 00031 { 00032 00053 class CTownArray 00054 { 00055 typedef map <int, map <int, CTown*> > TownArray; 00056 public: 00057 CTownArray(); 00058 virtual ~CTownArray(); 00059 00063 CTown* get(int x, int y); 00064 00069 void set(int x, int y, CTown town); 00070 00074 void erase(int x, int y); 00075 00079 void clear(); 00080 00084 unsigned int size(); 00085 00090 CTown* firstSibling(); 00091 00096 CTown* nextSibling(); 00097 00098 protected: 00099 TownArray m_towns; 00100 00101 // iterators for first() and next() 00102 TownArray::iterator m_first; 00103 map<int, CTown*>::iterator m_second; 00104 }; 00105 00106 } 00107 #endif // TOWNARRAY_H 00108 00109 // kate: space-indent off; tab-width 4; replace-tabs off;