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

level.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_LEVEL_INC_GUARD_H
00022 #define EASYSOK_LEVEL_INC_GUARD_H
00023 
00024 
00025 #include <qregexp.h>
00026 #include <qstring.h>
00027 #include <qstringlist.h>
00028 
00029 #include "compressed_map.h"
00030 #include "map.h"
00031 
00032 
00033 class Collection;
00034 class QDataStream;
00035 class QStringList;
00036 
00037 
00038 
00039 
00047 class Level
00048 {
00049 
00050 public:
00051 
00066     Level(Map const & map, QStringList const & authors, QStringList const & emails, QString const & homepage,
00067           QString const & copyright, QString const & name, QString const & info, int difficulty);
00068 
00069 
00091     Level(QStringList & lines, QStringList const & authors, QStringList const & emails,
00092           QString const & homepage, QString const & copyright, QString const & info, int difficulty);
00093 
00094 
00102     Level(QDataStream & stream, int version);
00103 
00104 
00109     Map const & map() const;
00110 
00111 
00118     void setMap(Map const & map);
00119 
00120 
00125     CompressedMap const & compressedMap() const;
00126 
00127 
00132     QStringList const & authors() const;
00133 
00134 
00139     QString authorLine() const;
00140 
00141 
00146     QString authorEmailLine() const;
00147 
00148 
00155     void setAuthors(QStringList const & authors);
00156 
00157 
00164     void setAuthorEmailLine(QString author_email_line);
00165 
00166 
00171     QStringList const & emails() const;
00172 
00173 
00180     void setEmails(QStringList const & emails);
00181 
00182 
00187     QString const & homepage() const;
00188 
00189 
00196     void setHomepage(QString const & homepage);
00197 
00198 
00203     QString const & copyright() const;
00204 
00205 
00212     void setCopyright(QString const & copyright);
00213 
00214 
00219     QString const & name() const;
00220 
00221 
00228     void setName(QString const & name);
00229 
00230 
00235     QString const & info() const;
00236 
00237 
00244     void setInfo(QString const & info);
00245 
00246 
00251     int difficulty() const;
00252 
00253 
00260     void setDifficulty(int difficulty);
00261 
00262 
00269     void writeToStream(QDataStream & stream) const;
00270 
00271 
00286     QString toText(QStringList const & authors, QStringList const & emails, QString const & homepage,
00287                    QString const & copyright, QString const & info, int difficulty) const;
00288 
00289 
00290 private:
00291 
00296     friend class Collection;
00297 
00298 
00317     static void getInfo(QStringList & lines, QStringList & authors, QStringList & emails,
00318                         QString & homepage, QString & copyright, QString & name,
00319                         QString & info, int & difficulty);
00320 
00321 
00330     static void parseAuthorEmailLine(QString const & author_email_line,
00331                                      QStringList & authors, QStringList & emails);
00332 
00333 
00341     static QString createAuthorEmailLine(QStringList const & authors, QStringList const & emails);
00342 
00343 
00348     CompressedMap m_compressed_map;
00349 
00350 
00355     Map m_map;
00356 
00357 
00362     QStringList m_authors;
00363 
00364 
00369     QStringList m_emails;
00370 
00371 
00376     QString m_homepage;
00377 
00378 
00383     QString m_copyright;
00384 
00385 
00390     QString m_name;
00391 
00392 
00397     QString m_info;
00398 
00399 
00404     int m_difficulty;
00405 };
00406 
00407 
00408 #endif

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