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

collection.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_COLLECTION_INC_GUARD_H
00022 #define EASYSOK_COLLECTION_INC_GUARD_H
00023 
00024 
00025 #include <vector>
00026 
00027 #include <qstring.h>
00028 #include <qstringlist.h>
00029 
00030 #include "level.h"
00031 
00032 
00033 class QDataStream;
00034 
00035 
00036 
00037 
00045 class Collection
00046 {
00047 
00048 public:
00049 
00063     Collection(QString const & name, QStringList const & authors, QStringList const & emails,
00064                QString const & homepage, QString const & copyright, QString const & info, int difficulty);
00065 
00066 
00073     Collection(QString const & collection);
00074 
00075 
00083     Collection(QDataStream & stream, int version);
00084 
00085 
00092     void writeToStream(QDataStream & stream) const;
00093 
00094 
00099     int numberOfLevels() const;
00100 
00101 
00106     QStringList const & authors() const;
00107 
00108 
00113     QString authorEmailLine() const;
00114 
00115 
00122     void setAuthors(QStringList const & authors);
00123 
00124 
00131     void setAuthorEmailLine(QString author_email_line);
00132 
00133 
00138     QStringList const & emails() const;
00139 
00140 
00147     void setEmails(QStringList const & emails);
00148 
00149 
00154     QString const & homepage() const;
00155 
00156 
00163     void setHomepage(QString const & homepage);
00164 
00165 
00170     QString const & copyright() const;
00171 
00172 
00179     void setCopyright(QString const & copyright);
00180 
00181 
00186     QString const & name() const;
00187 
00188 
00195     void setName(QString const & name);
00196 
00197 
00202     QString const & info() const;
00203 
00204 
00211     void setInfo(QString const & info);
00212 
00213 
00218     int difficulty() const;
00219 
00220 
00227     void setDifficulty(int difficulty);
00228 
00229 
00236     Level const & level(int index) const;
00237 
00238 
00245     void addLevel(Level const & level);
00246 
00247 
00255     void insertLevel(Level const & level, int index);
00256 
00257 
00265     void replaceLevel(Level const & level, int index);
00266 
00267 
00274     void removeLevel(int index);
00275 
00276 
00281     QString toText() const;
00282 
00283 
00284 private:
00285 
00290     std::vector<Level> m_levels;
00291 
00292 
00297     QStringList m_authors;
00298 
00299 
00304     QStringList m_emails;
00305 
00306 
00311     QString m_homepage;
00312 
00313 
00318     QString m_copyright;
00319 
00320 
00325     QString m_name;
00326 
00327 
00332     QString m_info;
00333 
00334 
00339     int m_difficulty;
00340 };
00341 
00342 
00343 #endif

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