Ship can now pick ghosts
[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     /*! Places all needed items for a level to (re)start.
17     Relies on the scene size to be explicitly set to a a value that will persist troughout play.
18     @param ghosts the number of ghosts to be placed on the map
19     @param rocks the number of rocks to be placed on the map
20     @param octopuses number of octopuses to be placed on the map
21     */
22     void setupMap(int ghosts, int rocks, int octopuses);
23
24     void spreadGhosts(int ghosts);
25
26     void removeGhost(QGraphicsItem * pGhost);
27
28 protected:
29
30     /*! Gives a pointer to a random position if a free one is found. Otherwise returns NULL.
31         The position is the upper left corner of a free 40x40 pixels slot.
32     */
33
34     QPointF* findRandomFreeSlot();
35
36     const QString ghostImageFilename_;
37     const QString rockImageFilename_;
38     const QString octopusImageFilename_;
39     const QStringList shipImageFilenames_;
40
41     QList<QPointF> freeTiles_;
42
43
44
45
46 };
47
48 #endif // SEASCENE_H