Moved "Restart game" place in menu
[ghostsoverboard] / seascene.h
index bfeb5cb..9fb0734 100644 (file)
@@ -2,6 +2,8 @@
 #define SEASCENE_H
 
 #include <QGraphicsScene>
+#include "screenlitkeeper.h"
+#include "level.h"
 
 class SeaScene : public QGraphicsScene
 {
@@ -11,15 +13,40 @@ public:
 
 signals:
 
+    void allGhostsPicked();
+    void pauseOn();
+    void pauseOff();
+    void vibrationActivated(bool on);
+
 public slots:
 
-    void setupMap(int ghosts, int rocks, int octopuses);
+    /*! Places all needed items for a level to (re)start.
+    Relies on the scene size to be explicitly set to a a value that will persist troughout play.
+    @param ghosts the number of ghosts to be placed on the map
+    @param rocks the number of rocks to be placed on the map
+    @param octopuses number of octopuses to be placed on the map
+    */
+    void setupMap(int ghosts, int rocks, int octopuses, int octopusSpeed);
+
+    void setupMap(Level level);
 
     void spreadGhosts(int ghosts);
 
+    void removeGhost(QGraphicsItem * pGhost);
+
+    void ghostsDropped(int ghosts);
+
+    void pause (bool paused);
+
+    void vibrationActivate(bool);
+
 protected:
 
-    QPointF findRandomFreeSlot();
+    /*! Gives a pointer to a random position if a free one is found. Otherwise returns NULL.
+        The position is the upper left corner of a free 40x40 pixels slot.
+    */
+
+    QPointF* findRandomFreeSlot();
 
     const QString ghostImageFilename_;
     const QString rockImageFilename_;
@@ -28,6 +55,14 @@ protected:
 
     QList<QPointF> freeTiles_;
 
+    int ghostsLeft_;
+
+    QList<QGraphicsItem*> movingItems_;
+
+    bool paused_;
+
+    ScreenLitKeeper screenLitKeeper_;
+