Making the flow animation skippable.
[evilplumber] / src / game.h
index 99af4b2..4fa333d 100644 (file)
@@ -85,7 +85,7 @@ static const Piece ppieces[] = {
     {PieceCorners, 0, true, 4, 0,            // 8
      {DirLeft, DirDown, DirRight, DirUp}},
     {PieceCorners, 90, true, 4, 1,          // 9
-     {DirUp, DirLeft, DirRight, DirDown}},
+     {DirRight, DirDown, DirLeft, DirUp}},
     {PieceStart, 0, false, 0, 0,             // 10
      {DirLeft, DirNone, DirNone, DirNone}},
     {PieceStart, 90, false, 0, 0,            // 11
@@ -192,14 +192,16 @@ signals:
     void levelFailed();
 
 private slots:
+    void onDoneClicked();
     void onCellClicked(int row, int column);
     void onValidPieceSelected(const Piece* piece);
     void onInvalidPieceSelected();
     void onTimeout();
-    void levelEnds();
     void computeFlow();
 
 private:
+    void levelEnds();
+
     AvailablePieces* pieceUi; // Not owned
     GameField* fieldUi; // Not owned
     QLabel* timeLabel; // Not owned
@@ -222,6 +224,7 @@ private:
     Direction flowDir;
     int flowPreplaced;
     int flowScore;
+    bool animate;
 };
 
 class LevelSwitcher : public QObject
@@ -231,7 +234,7 @@ public:
     LevelSwitcher(GameController* gameController,
                   QWidget* levelWidget, QListWidget* levelList, QPushButton* levelStartButton,
                   QWidget* startWidget, QLabel* startTitle, QLabel* startLabel, QPushButton* startButton,
-                  QLabel* levelLabel, QLabel* scoreLabel,
+                  QWidget* gameWidget, QLabel* levelLabel, QLabel* scoreLabel,
                   QStringList levels);
 
 private slots:
@@ -243,6 +246,9 @@ private slots:
 
 private:
     void initiateLevel();
+    void readSavedGames();
+    void writeSavedGames();
+    void readLevelCollections(QStringList collections);
 
     GameController* gameController; // Not owned
     QWidget* levelWidget; // Not owned
@@ -252,13 +258,16 @@ private:
     QLabel* startTitle; // Not owned
     QLabel* startLabel; // Not owned
     QPushButton* startButton; // Not owned
+    QWidget* gameWidget; // Not owned
     QLabel* levelLabel; // Not owned
     QLabel* scoreLabel; // Not owned
 
-    QStringList levelCollections;
+    QString curColl;
     QStringList levels;
     int level;
     int totalScore;
+    QHash<QString, int> savedGames; // level collection -> next level ix
+    QHash<QString, QStringList> levelCollections; // level collection -> level names
 };
 
 #endif