Spreading ghosts now handles situations where there is no free slot left
[ghostsoverboard] / seascene.h
1 #ifndef SEASCENE_H
2 #define SEASCENE_H
3
4 #include <QGraphicsScene>
5
6 class SeaScene : public QGraphicsScene
7 {
8     Q_OBJECT
9 public:
10     explicit SeaScene(QObject *parent = 0);
11
12 signals:
13
14 public slots:
15
16     void setupMap(int ghosts, int rocks, int octopuses);
17
18     void spreadGhosts(int ghosts);
19
20 protected:
21
22     /*! Gives a pointer to a random position if a free one is found. Otherwise returns NULL.
23         The position is the upper left corner of a free 40x40 pixels slot.
24     */
25
26     QPointF* findRandomFreeSlot();
27
28     const QString ghostImageFilename_;
29     const QString rockImageFilename_;
30     const QString octopusImageFilename_;
31     const QStringList shipImageFilenames_;
32
33     QList<QPointF> freeTiles_;
34
35
36
37
38 };
39
40 #endif // SEASCENE_H