Diffstat (limited to 'noncore/games/kcheckers/checkers.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/games/kcheckers/checkers.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/noncore/games/kcheckers/checkers.h b/noncore/games/kcheckers/checkers.h new file mode 100644 index 0000000..bd2be08 --- a/dev/null +++ b/noncore/games/kcheckers/checkers.h | |||
@@ -0,0 +1,56 @@ | |||
1 | #ifndef CHECKERS_H | ||
2 | #define CHECKERS_H | ||
3 | |||
4 | #define NONE 0 | ||
5 | #define MAN1 1 | ||
6 | #define KING1 2 | ||
7 | #define FREE 3 | ||
8 | #define KING2 4 | ||
9 | #define MAN2 5 | ||
10 | #define FULL 6 | ||
11 | |||
12 | #define UL -6 | ||
13 | #define UR -5 | ||
14 | #define DL 5 | ||
15 | #define DR 6 | ||
16 | |||
17 | |||
18 | class Checkers | ||
19 | { | ||
20 | public: | ||
21 | Checkers(int); | ||
22 | virtual bool go1(int,int)=0; | ||
23 | |||
24 | void go2(); | ||
25 | bool checkMove1(); | ||
26 | bool checkMove2(); | ||
27 | |||
28 | virtual bool checkCapture1()=0; | ||
29 | virtual bool checkCapture2()=0; | ||
30 | |||
31 | void setLevel(int i) {levelmax=i;}; | ||
32 | int getBoard(int i) {return board[i];}; | ||
33 | |||
34 | protected: | ||
35 | int level; // Current level | ||
36 | int levelmax; // Maximum level | ||
37 | |||
38 | int turn(); | ||
39 | void turn(int &,bool capture=false); | ||
40 | |||
41 | int to; | ||
42 | int board[54]; | ||
43 | int bestboard[54]; | ||
44 | int bestcounter; | ||
45 | |||
46 | virtual void kingMove2(int,int &)=0; | ||
47 | |||
48 | virtual bool manCapture2(int,int &)=0; | ||
49 | virtual bool kingCapture2(int,int,int &)=0; | ||
50 | |||
51 | virtual bool manCapture1(int,int,bool &)=0; | ||
52 | virtual bool kingCapture1(int,int,bool &)=0; | ||
53 | |||
54 | }; | ||
55 | |||
56 | #endif | ||