Fixed bug with non-working control buttons.
[vexed] / levelpack.h
1 #ifndef LEVELPACK_H
2 #define LEVELPACK_H
3
4 #include <QtCore>
5 #include "playfield.h"
6
7 class LevelPack
8 {
9
10 private:
11         QFile file;
12
13         bool lookSection(const char *section);
14         QString getLine();
15         bool loadPackProperty();
16         QPair<QString, QString> *loadProperty();
17         void loadLevel();
18         QMap <QString,QString> props;
19 public:
20 // Move to private
21         QList<PlayField *> levels;
22
23
24         LevelPack(const QString &fileName);
25         ~LevelPack();
26
27         QString getURL(){return props["URL"];}
28         QString getAuthor(){return props["Author"];}
29         QString getDescription(){return props["Description"];}
30         const QString& getTitle(){return props["title"];}
31         PlayField *levelAt(int levelNo)
32         {
33                 return levels.at(levelNo);
34         }
35         int size()
36         {
37                 return levels.size();
38         }
39 };
40
41 #endif // LEVELPACK_H