summaryrefslogtreecommitdiffstats
path: root/klines/field.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 /klines/field.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 'klines/field.h')
-rw-r--r--klines/field.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/klines/field.h b/klines/field.h
new file mode 100644
index 00000000..de9ee8ce
--- /dev/null
+++ b/klines/field.h
@@ -0,0 +1,65 @@
+/***************************************************************************
+ begin : Fri May 19 2000
+ copyright : (C) 2000 by Roman Merzlyakov
+ email : roman@sbrf.barrt.ru
+ copyright : (C) 2000 by Roman Razilov
+ email : Roman.Razilov@gmx.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef FIELD_H
+#define FIELD_H
+
+#include <qobject.h>
+#include <qwidget.h>
+#include "cell.h"
+// size of game field
+#define NUMCELLSW 9
+#define NUMCELLSH 9
+
+class Field: public QWidget
+{
+ Q_OBJECT
+public:
+ void clearField();
+
+ int calcPosScore(int x, int y, int whatIf);
+ void saveUndo();
+
+protected:
+ Field(QWidget* parent, const char* name);
+ ~Field();
+
+ void putBall(int x, int y, int color);
+ void putBallRun(int x, int y, int color);
+ void removeBall(int x, int y );
+ int getBall(int x, int y);
+ int getAnim(int x, int y);
+ void setAnim(int x, int y, int anim );
+ void clearAnim();
+ int deleteAnimatedBalls();
+ void moveBall(int xa, int ya, int xb, int yb);
+ int calcRun(int sx, int sy, int dx, int dy);
+
+
+ bool checkBounds( int x, int y );
+// virtual int erase5Balls(){ return 0;}
+ int freeSpace();
+ void restoreUndo();
+
+private:
+ Cell field[NUMCELLSH][NUMCELLSW];
+ Cell field_undo[NUMCELLSH][NUMCELLSW];
+// void search5Balls();
+
+};
+
+#endif