summaryrefslogtreecommitdiffstats
path: root/libksirtet/lib/mp_simple_board.h
blob: 2131feb23520664d29b36c8962630d70e656d695 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef MP_SIMPLE_BOARD_H
#define MP_SIMPLE_BOARD_H

#include "mp_board.h"
#include "mp_simple_types.h"

#include <kdemacros.h>

class KDE_EXPORT MPSimpleBoard : public MPBoard
{
 Q_OBJECT
		
 public:
    MPSimpleBoard(QWidget *parent = 0, const char *name = 0)
	: MPBoard(parent, name) {}
	virtual ~MPSimpleBoard() {}

	void init(bool AI, bool multiplayers, bool server, bool first,
			  const QString &name);
	void dataOut(QDataStream &s);
	void dataIn(QDataStream &s);
	
 protected:
	virtual void _init(bool AI, bool multiplayers, bool server, bool first,
					   const QString &name) = 0;
	virtual void _initFlag(QDataStream &s) = 0;
	virtual void _playFlag(QDataStream &s) = 0;
	virtual void _pauseFlag(bool pause)    = 0;
	virtual void _stopFlag(bool gameover)  = 0;
	virtual void _dataOut(QDataStream &s)  = 0;
	virtual void _gameOverDataOut(QDataStream &s) = 0;
	virtual void _initDataOut(QDataStream &s) = 0;

 private:
	BoardState state;
	
	void initFlag(QDataStream &s);
	void playFlag(QDataStream &s);
	void pauseFlag();
	void stopFlag();
	void gameOverFlag();
	void _stop(bool button);
};

#endif // MP_SIMPLE_BOARD_H