summaryrefslogtreecommitdiff
blob: 8aece9b475768fb18d5b691a4f02c41387d0693a (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
diff -ur hexxagon-1.0.original/src/libhexx/bitboard64.h hexxagon-1.0/src/libhexx/bitboard64.h
--- hexxagon-1.0.original/src/libhexx/bitboard64.h	2005-01-13 23:19:07.000000000 +0200
+++ hexxagon-1.0/src/libhexx/bitboard64.h	2009-08-13 06:51:10.000000000 +0300
@@ -19,12 +19,12 @@
  * 
  */
 
-
 #ifndef _BITBOARD64_H
 #define _BITBOARD64_H
 
 #include <netinet/in.h>
 #include <iostream>
+#include <cstdio>
 
 namespace libhexx 
 {
@@ -54,14 +54,12 @@
         {
             printf("0x%X, 0x%X\n", lowbits, highbits);
         };
-        
-        friend std::ostream& operator<<(std::ostream &output, const class BitBoard64 &b);
-		friend std::istream& operator>>(std::istream &input, class BitBoard64 &b);
-		
-	private:
-		
+
 		uint32_t lowbits, highbits;
 	};
+	
+	std::ostream& operator<<(std::ostream &output, const class BitBoard64 &b);
+	std::istream& operator>>(std::istream &input, class BitBoard64 &b);
 }
 
 #endif
diff -ur hexxagon-1.0.original/src/libhexx/board.h hexxagon-1.0/src/libhexx/board.h
--- hexxagon-1.0.original/src/libhexx/board.h	2005-01-16 13:12:23.000000000 +0200
+++ hexxagon-1.0/src/libhexx/board.h	2009-08-13 07:03:48.000000000 +0300
@@ -25,7 +25,6 @@
 
 #include "bitboard64.h"
 #include "lookup.h"
-#include "move.h"
 #include "layout.h"
 
 #include <iostream>
@@ -33,8 +32,21 @@
 
 namespace libhexx 
 {
-    class Move;
-    class MoveList;
+	class Move
+	{
+		public:
+            Move();
+            Move(int t);
+            Move(int f, int t);
+
+            operator bool() const;
+            
+            char from, to;
+            int score;
+	};
+
+    bool scoreMoves(std::vector<Move> &moves, class Board board,
+		const LookUp& lookUp, int depth, bool (*callback)(), int maxtime);
 
     enum 
     {
diff -ur hexxagon-1.0.original/src/libhexx/libhexx.h hexxagon-1.0/src/libhexx/libhexx.h
--- hexxagon-1.0.original/src/libhexx/libhexx.h	2005-01-13 23:19:07.000000000 +0200
+++ hexxagon-1.0/src/libhexx/libhexx.h	2009-08-13 06:53:35.000000000 +0300
@@ -19,6 +19,8 @@
  * 
  */
 
+#ifndef _LIBHEXX_H
+#define _LIBHEXX_H
 
 #include "bitboard64.h"
 #include "move.h"
@@ -27,3 +29,5 @@
 #include "lookup.h"
 #include "view.h"
 #include "layout.h"
+
+#endif
diff -ur hexxagon-1.0.original/src/libhexx/lookup.h hexxagon-1.0/src/libhexx/lookup.h
--- hexxagon-1.0.original/src/libhexx/lookup.h	2005-01-13 23:19:07.000000000 +0200
+++ hexxagon-1.0/src/libhexx/lookup.h	2009-08-13 06:51:10.000000000 +0300
@@ -27,6 +27,8 @@
 
 namespace libhexx
 {
+	class BitBoard64;
+
 	int getHexxagonIndex(int x, int y);
 
 	class LookUp
diff -ur hexxagon-1.0.original/src/libhexx/move.cpp hexxagon-1.0/src/libhexx/move.cpp
--- hexxagon-1.0.original/src/libhexx/move.cpp	2005-01-16 13:12:23.000000000 +0200
+++ hexxagon-1.0/src/libhexx/move.cpp	2009-08-13 06:51:10.000000000 +0300
@@ -114,4 +114,11 @@
     return true;
 }
 
-
+Move::Move() { from = 99; to = 99;};
+Move::Move(int t) { from = t; to = t; };
+Move::Move(int f, int t) { from = f; to = t; };
+          
+Move::operator bool() const
+{
+	return from != 99 && to != 99;
+}
diff -ur hexxagon-1.0.original/src/libhexx/move.h hexxagon-1.0/src/libhexx/move.h
--- hexxagon-1.0.original/src/libhexx/move.h	2005-01-13 23:19:07.000000000 +0200
+++ hexxagon-1.0/src/libhexx/move.h	2009-08-13 06:51:10.000000000 +0300
@@ -23,19 +23,19 @@
 #ifndef _MOVE_H
 #define _MOVE_H
 
-#include "board.h"
-
 #include <list>
 #include <vector>
 
 namespace libhexx 
 {
+	class Board;
+	
     class Move
     {
         public:
-            Move() { from = 99; to = 99;};
-            Move(int t) { from = t; to = t; };
-            Move(int f, int t) { from = f; to = t; };
+            Move();
+            Move(int t);
+            Move(int f, int t);
 
             inline bool operator<(const Move &r) const
             {
@@ -47,7 +47,7 @@
                 return (score != r.score);
             };
           
-            operator bool() const { return from != 99 && to != 99; };
+            operator bool() const;
             
             char from, to;
             int score;