diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | c90c389a8a8d9d8661e9772ec4144c5cf2039f23 (patch) | |
tree | 6d8391395bce9eaea4ad78958617edb20c6a7573 /kolf/floater.h | |
download | tdegames-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 'kolf/floater.h')
-rw-r--r-- | kolf/floater.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/kolf/floater.h b/kolf/floater.h new file mode 100644 index 00000000..486f3bc0 --- /dev/null +++ b/kolf/floater.h @@ -0,0 +1,81 @@ +#ifndef FLOATER_H +#define FLOATER_H + +#include "game.h" + +class Floater; +class FloaterConfig : public BridgeConfig +{ + Q_OBJECT + +public: + FloaterConfig(Floater *floater, QWidget *parent); + +private slots: + void speedChanged(int news); + +private: + Floater *floater; +}; + +class FloaterGuide : public Wall +{ +public: + FloaterGuide(Floater *floater, QCanvas *canvas) : Wall(canvas) { this->floater = floater; almostDead = false; } + virtual void setPoints(int xa, int ya, int xb, int yb); + virtual void moveBy(double dx, double dy); + virtual Config *config(QWidget *parent); + virtual void aboutToDelete(); + virtual void aboutToDie(); + +private: + Floater *floater; + bool almostDead; +}; + +class Floater : public Bridge +{ +public: + Floater(QRect rect, QCanvas *canvas); + virtual bool collision(Ball *ball, long int id) { Bridge::collision(ball, id); return false; } + virtual void saveState(StateDB *db); + virtual void loadState(StateDB *db); + virtual void save(KConfig *cfg); + virtual void load(KConfig *cfg); + virtual bool loadLast() const { return true; } + virtual void firstMove(int x, int y); + virtual void aboutToSave(); + virtual void aboutToDie(); + virtual void savingDone(); + virtual void setGame(KolfGame *game); + virtual void editModeChanged(bool changed); + virtual bool moveable() const { return false; } + virtual void moveBy(double dx, double dy); + virtual Config *config(QWidget *parent) { return new FloaterConfig(this, parent); } + virtual QPtrList<QCanvasItem> moveableItems() const; + virtual void advance(int phase); + void setSpeed(int news); + int curSpeed() const { return speed; } + + // called by floaterguide when changed; + void reset(); + +private: + int speedfactor; + int speed; + FloaterGuide *wall; + QPoint origin; + Vector vector; + bool noUpdateZ; + bool haventMoved; + QPoint firstPoint; +}; + +class FloaterObj : public Object +{ +public: + FloaterObj() { m_name = i18n("Floater"); m__name = "floater"; } + virtual QCanvasItem *newObject(QCanvas *canvas) { return new Floater(QRect(0, 0, 80, 40), canvas); } +}; + +#endif |