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

Collection Class Reference

This class represents a collection of sokoban levels. More...

#include <collection.h>

List of all members.

Public Methods

 Collection (QString const &name, QStringList const &authors, QStringList const &emails, QString const &homepage, QString const &copyright, QString const &info, int difficulty)
 Collection (QString const &collection)
 Collection (QDataStream &stream, int version)
void writeToStream (QDataStream &stream) const
int numberOfLevels () const
QStringList const & authors () const
QString authorEmailLine () const
void setAuthors (QStringList const &authors)
void setAuthorEmailLine (QString author_email_line)
QStringList const & emails () const
void setEmails (QStringList const &emails)
QString const & homepage () const
void setHomepage (QString const &homepage)
QString const & copyright () const
void setCopyright (QString const &copyright)
QString const & name () const
void setName (QString const &name)
QString const & info () const
void setInfo (QString const &info)
int difficulty () const
void setDifficulty (int difficulty)
Level const & level (int index) const
void addLevel (Level const &level)
void insertLevel (Level const &level, int index)
void replaceLevel (Level const &level, int index)
void removeLevel (int index)
QString toText () const

Private Attributes

std::vector< Levelm_levels
QStringList m_authors
QStringList m_emails
QString m_homepage
QString m_copyright
QString m_name
QString m_info
int m_difficulty


Detailed Description

This class represents a collection of sokoban levels.

Author:
Ralf Schmelter (ralfs@pc2a.chemie.uni-dortmund.de).
Version:
0.1


Constructor & Destructor Documentation

Collection::Collection QString const & name,
QStringList const & authors,
QStringList const & emails,
QString const & homepage,
QString const & copyright,
QString const & info,
int difficulty
 

Creates an empty collection.

Parameters:
name   The name of the collection.
authors   The authors of the collection.
emails   The emails addresses of the authors of the collection.
homepage   The homepage of the collection.
copyright   A copyright string.
info   Additional info.
difficulty   The difficulty of the level in the range[-1:10], with 0 being trivially easy. -1 means an unknown difficulty.

Collection::Collection QString const & collection
 

Loads the level collection from a file in xsokoban format.

Parameters:
collection   The filename of the collection to load.

Collection::Collection QDataStream & stream,
int version
 

Reads the level collection from a data stream.

Parameters:
stream   The stream to use.
version   The version to use.


Member Function Documentation

void Collection::addLevel Level const & level
 

Adds a new level to the end of the collection.

Parameters:
level   The level to add.

QString Collection::authorEmailLine const
 

Returns the author-email-line (the authors with appended email, separated by commas).

QStringList const& Collection::authors const
 

Returns the name of the authors.

QString const& Collection::copyright const
 

Returns the copyright of the collection.

int Collection::difficulty const
 

Returns the difficulty of the collection.

QStringList const& Collection::emails const
 

Returns the email adresses of the authors.

QString const& Collection::homepage const
 

Returns the home of the collection/author.

QString const& Collection::info const
 

Returns additional info of the level collection.

void Collection::insertLevel Level const & level,
int index
 

Insert a new level at the given index (see std::vector<>insert for where it is inserted).

Parameters:
level   The level to insert.
index   The index to insert.

Level const& Collection::level int index const
 

Returns a pointer to the level with the given index.

Parameters:
index   The index of the level.

QString const& Collection::name const
 

Returns the name of the level collection.

int Collection::numberOfLevels const
 

Returns the number of levels.

void Collection::removeLevel int index
 

Removes the level at the given index.

Parameters:
index   The position of the level.

void Collection::replaceLevel Level const & level,
int index
 

Replaces the level at the given index.

Parameters:
level   The new level.
index   The index of the level to replace.

void Collection::setAuthorEmailLine QString author_email_line
 

Sets the authors and emails from the given line.

Parameters:
author_email_line   The line containing (separated by ',') the authors and emails.

void Collection::setAuthors QStringList const & authors
 

Sets the name of the authors.

Parameters:
authors   The new names of the authors.

void Collection::setCopyright QString const & copyright
 

Sets a new copyright.

Parameters:
copyright   The new copyright.

void Collection::setDifficulty int difficulty
 

Sets the difficulty of the collection.

Parameters:
difficulty   The new difficulty.

void Collection::setEmails QStringList const & emails
 

Sets the email adddresses of the authors.

Parameters:
emails   The email adddresses of the authors.

void Collection::setHomepage QString const & homepage
 

Sets a new homepage.

Parameters:
homepage   The new homepage.

void Collection::setInfo QString const & info
 

Sets a new info.

Parameters:
info   The new info.

void Collection::setName QString const & name
 

Sets a new name.

Parameters:
name   The new name.

QString Collection::toText const
 

Returns the maps of the level collection in xsb format.

void Collection::writeToStream QDataStream & stream const
 

Writes the level collection to a data stream.

Parameters:
stream   The stream to use.


Member Data Documentation

QStringList Collection::m_authors [private]
 

The authors.

QString Collection::m_copyright [private]
 

The copyright.

int Collection::m_difficulty [private]
 

The difficulty.

QStringList Collection::m_emails [private]
 

The email adddresses of the authors.

QString Collection::m_homepage [private]
 

The homepage.

QString Collection::m_info [private]
 

Additional info of the collection.

std::vector<Level> Collection::m_levels [private]
 

The levels of the collection.

QString Collection::m_name [private]
 

The name of the collection.


The documentation for this class was generated from the following file:
Generated at Sun Jan 6 18:49:10 2002 for EasySok by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001