summaryrefslogtreecommitdiffstats
path: root/libksirtet/common/board.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitc90c389a8a8d9d8661e9772ec4144c5cf2039f23 (patch)
tree6d8391395bce9eaea4ad78958617edb20c6a7573 /libksirtet/common/board.h
downloadtdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.tar.gz
tdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libksirtet/common/board.h')
-rw-r--r--libksirtet/common/board.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/libksirtet/common/board.h b/libksirtet/common/board.h
new file mode 100644
index 00000000..97c37c17
--- /dev/null
+++ b/libksirtet/common/board.h
@@ -0,0 +1,75 @@
+#ifndef COMMON_BOARD_H
+#define COMMON_BOARD_H
+
+#include "base/board.h"
+
+#include "lib/libksirtet_export.h"
+
+class GiftPool;
+class AI;
+
+class LIBKSIRTET_EXPORT Board : public BaseBoard
+{
+ Q_OBJECT
+ public:
+ Board(bool graphic, GiftPool *, QWidget *parent);
+ virtual ~Board();
+
+ void setType(bool computer);
+ virtual void start(const GTInitData &);
+ void unpause();
+ void stop();
+
+ virtual uint gift() = 0;
+ virtual bool needRemoving() = 0;
+
+ GiftPool *giftPool() const { return _giftPool; }
+
+ public slots:
+ void pMoveLeft();
+ void pMoveRight();
+ void pDropDownStart();
+ void pDropDownStop();
+ void pOneLineDown();
+ void pRotateLeft();
+ void pRotateRight();
+ void pMoveLeftTotal();
+ void pMoveRightTotal();
+
+ private slots:
+ bool timeout();
+
+ signals:
+ void levelUpdated();
+
+ protected:
+ KRandomSequence randomGarbage;
+
+ virtual bool beforeGlue(bool bump, bool first);
+ virtual void gluePiece();
+ virtual bool afterGlue(bool /*doAll*/, bool /*first*/) { return false; }
+ virtual bool afterGift(bool /*first*/) { return false; }
+ virtual bool putGift(uint) = 0;
+
+ virtual uint normalTime() const;
+ void updateLevel();
+
+ void settingsChanged();
+
+ private:
+ uint _dropHeight;
+ GiftPool *_giftPool;
+ AI *aiEngine;
+
+ bool newPiece();
+ void pieceDropped(uint dropHeight);
+ void _afterGift(bool first);
+ void _beforeGlue(bool first);
+ void _afterGlue(bool first);
+ bool afterAfterRemove();
+ bool startTimer();
+ void showBoard(bool show);
+ void updateLevel(uint newLevel);
+};
+
+#endif