summaryrefslogtreecommitdiffstats
path: root/libksirtet/lib/mp_simple_board.h
blob: 24a7654fc297921fe319a9c4879856c77c7db93c (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
46
#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
  TQ_OBJECT
		
 public:
    MPSimpleBoard(TQWidget *tqparent = 0, const char *name = 0)
	: MPBoard(tqparent, name) {}
	virtual ~MPSimpleBoard() {}

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

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

#endif // MP_SIMPLE_BOARD_H