From c90c389a8a8d9d8661e9772ec4144c5cf2039f23 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: 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 --- libksirtet/common/board.h | 75 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 libksirtet/common/board.h (limited to 'libksirtet/common/board.h') 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 -- cgit v1.2.1