attackKing.h Source File

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
attackKing.h
Go to the documentation of this file.
1
4 #ifndef EVAL_ENDGAME_ATTACKKING_H
5 #define EVAL_ENDGAME_ATTACKKING_H
6
7 #include "osl/eval/endgame/kingPieceTable.h"
8 #include "osl/state/simpleState.h"
9
10 namespace osl
11 {
12 namespace eval
13 {
14 namespace endgame
15 {
19 class AttackKing
20 {
21 struct Table : public KingPieceTable
22 {
23 Table();
24 private:
25 void adhoc_edge_king_1(const Player player,
26 const Square king,
27 const Square attack);
28 void adhoc_edge_king_2(const Player player,
29 const Square king,
30 const Square attack);
31 };
32 static Table table;
33 public:
34 static int valueOf(const Piece king, const Piece attacker)
35 {
36 return valueOf(king, attacker.ptypeO(), attacker.square());
37 }
38 static int valueOf(Piece king, PtypeO ptypeo, Square position)
39 {
40 assert(king.ptype() == KING);
41 if (getOwner(ptypeo) == king.owner())
42 return 0;
43 return table.valueOf(king.square(), king.owner(),
44 position, getPtype(ptypeo));
45 }
46 static void saveText(const char *filename);
47 static void loadText(const char *filename) { table.loadText(filename); }
48 static void resetWeights(const int *w) { table.resetWeights(w); }
49 };
50 } // namespace endgame
51 } // namespace endgame
52 } // namespace osl
53
54 #endif /* EVAL_ENDGAME_ATTACKKING_H */
55 // ;;; Local Variables:
56 // ;;; mode:c++
57 // ;;; c-basic-offset:2
58 // ;;; coding:utf-8
59 // ;;; End: