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