Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

compressed_map.h

00001 /*
00002  *   EasySok --- A(nother) sokoban game for KDE.
00003  *
00004  *   Copyright (C) 2001 by Ralf Schmelter (ralfs@pc2a.chemie.uni-dortmund.de).
00005  *
00006  *   This program is free software; you can redistribute it and/or modify
00007  *   it under the terms of the GNU General Public License version 2 as
00008  *   published by the Free Software Foundation.
00009  *
00010  *   This program is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with this program; if not, write to the Free Software
00017  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018  */
00019 
00020 
00021 #ifndef EASYSOK_COMPRESSED_MAP_INC_GUARD_H
00022 #define EASYSOK_COMPRESSED_MAP_INC_GUARD_H
00023 
00024 
00025 #include <vector>
00026 
00027 #include <qglobal.h>
00028 
00029 
00030 class Map;
00031 class QDataStream;
00032 
00033 
00034 
00035 
00052 class CompressedMap
00053 {
00054 
00055 public:
00056 
00063     CompressedMap(Map const & map);
00064 
00065 
00072     CompressedMap(QDataStream & stream);
00073 
00074 
00079     int width() const;
00080 
00081 
00086     int height() const;
00087 
00088 
00093     int numberOfEmptyGoals() const;
00094 
00095 
00100     int keeperIndex() const;
00101 
00102 
00109     void setPieces(std::vector<int> & pieces) const;
00110 
00111 
00118     bool operator == (CompressedMap const & other_map) const;
00119 
00120 
00127     bool operator != (CompressedMap const & other_map) const;
00128 
00129 
00136     bool operator < (CompressedMap const & other_map) const;
00137 
00138 
00145     void writeToStream(QDataStream & stream) const;
00146 
00147 
00148 private:
00149 
00154     int codesLength() const;
00155 
00156 
00161     Q_UINT8 m_width;
00162 
00163 
00168     Q_UINT8 m_height;
00169 
00170 
00175     Q_UINT16 m_empty_goals;
00176 
00177 
00182     Q_UINT16 m_keeper_index;
00183 
00184 
00189     std::vector<Q_UINT32> m_codes;
00190 };
00191 
00192 
00193 #endif

Generated at Sun Jan 6 18:49:09 2002 for EasySok by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001