summaryrefslogtreecommitdiffstats
path: root/libksirtet/lib/mp_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/lib/mp_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/lib/mp_board.h')
-rw-r--r--libksirtet/lib/mp_board.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/libksirtet/lib/mp_board.h b/libksirtet/lib/mp_board.h
new file mode 100644
index 00000000..fbd1e01f
--- /dev/null
+++ b/libksirtet/lib/mp_board.h
@@ -0,0 +1,51 @@
+#ifndef MP_BOARD_H
+#define MP_BOARD_H
+
+#include <qwidget.h>
+
+/**
+ * The MP_Board class is the base widget from which each individual
+ * board should inheritate ; you must implement its virtual methods.
+ */
+class MPBoard : public QWidget
+{
+ Q_OBJECT
+
+ public:
+ MPBoard(QWidget *parent, const char *name=0)
+ : QWidget(parent, name) {}
+ virtual ~MPBoard() {}
+
+ /**
+ * This method is called once at the board creation.
+ * @param AI is TRUE if the player is not human.
+ * @param multiplayers is TRUE if the game is not a single player game.
+ * @param first is TRUE if this board is the first local one.
+ */
+ virtual void init(bool AI, bool multiplayers, bool server, bool first,
+ const QString &name) = 0;
+
+ /**
+ * Put data on the stream.
+ *
+ * This method is the communication way out. The data given here will
+ * be the only information that will go to the server.
+ */
+ virtual void dataOut(QDataStream &) = 0;
+
+ /**
+ * Get data from the stream.
+ *
+ * This method is the communication way in. The data given here will be
+ * the only information that you will receive from the server.
+ */
+ virtual void dataIn(QDataStream &) = 0;
+
+ signals:
+ /**
+ * Call this signal to enable/disable the keys associated with a board.
+ */
+ void enableKeys(bool);
+};
+
+#endif // MP_BOARD_H