Another levelset now exists internally
[ghostsoverboard] / seascene.h
index 6d932ab..fefdfc0 100644 (file)
 #define SEASCENE_H
 
 #include <QGraphicsScene>
+#include<QGraphicsItemGroup>
 #include "screenlitkeeper.h"
 #include "level.h"
+#include "levelset.h"
+#include <QAction>
+#include <QTimer>
+#include <QSystemDeviceInfo>
+#include <QTime>
+
+using namespace QtMobility;
 
 class SeaScene : public QGraphicsScene
 {
@@ -40,6 +48,9 @@ signals:
     void pauseOn();
     void pauseOff();
     void vibrationActivated(bool on);
+    void minimizeRequested();
+    void fullscreenRequested();
+    void deviceJustLocked();
 
 public slots:
 
@@ -63,6 +74,30 @@ public slots:
 
     void vibrationActivate(bool);
 
+    void handleScreenTapped();
+
+    void about();
+
+    void restartLevel();
+
+    void nextLevel();
+
+    void restartGame();
+
+    void forcePause();
+
+    void softContinue();
+
+    void setItemPointersNull();
+
+    void turnPauseOn();
+
+    void handleDeviceLocked(bool isLocked);
+
+    void pollDeviceLocked();
+
+
+
 protected:
 
     /*! Gives a pointer to a random position if a free one is found. Otherwise returns NULL.
@@ -71,6 +106,12 @@ protected:
 
     QPointF* findRandomFreeSlot();
 
+    void createMenuItems();
+    void prepareForMenu(QGraphicsItem * pItem);
+    void createAboutBoxItems();
+    void createVictoryItems();
+    void createLevelCompletedItems();
+
     const QString ghostImageFilename_;
     const QString rockImageFilename_;
     const QString octopusImageFilename_;
@@ -86,8 +127,45 @@ protected:
 
     ScreenLitKeeper screenLitKeeper_;
 
+    int menuItemCount_;
+
+    QGraphicsTextItem * pPausetextItem_;
+
+    QGraphicsTextItem * pRestartLevelItem_;
+    QGraphicsTextItem * pRestartGameItem_;
+    QGraphicsTextItem * pSettingsItem_;
+    QGraphicsTextItem * pAboutItem_;
+    QGraphicsTextItem * pQuitItem_;
+    QGraphicsTextItem * pMinimizeItem_;
+
+    QGraphicsTextItem * pVictoryCongratulationsItem_;
+    QGraphicsTextItem * pVictoryScoreItem_;
+    QGraphicsTextItem * pAboutBoxItem_;
+
+    QGraphicsTextItem * pLevelCompletedItem_;
+
+    QList<Levelset> availableLevelsets_;
+
+    Levelset levelset_;
+
+    int currentLevel_;
+
+
+    QAction* pVibrateAction_;
+
+    QAction* pPauseAction_;
+
+    QTimer autopauseTimer;
+
+    QSystemDeviceInfo deviceInfo_;
+
+    bool alreadyLocked_;
 
+    QTimer deviceLockPollTimer_;
 
+    QTime scoreCounter_;
+    int totalScore_;
+    int levelScore_;
 
 };