00001
00004 #ifndef EVAL_ENDGAME_ATTACKKING_H
00005 #define EVAL_ENDGAME_ATTACKKING_H
00006
00007 #include "osl/eval/endgame/kingPieceTable.h"
00008 #include "osl/state/simpleState.h"
00009
00010 namespace osl
00011 {
00012 namespace eval
00013 {
00014 namespace endgame
00015 {
00019 class AttackKing
00020 {
00021 struct Table : public KingPieceTable
00022 {
00023 Table();
00024 private:
00025 void adhoc_edge_king_1(const Player player,
00026 const Position king,
00027 const Position attack);
00028 void adhoc_edge_king_2(const Player player,
00029 const Position king,
00030 const Position attack);
00031 };
00032 static const Table table;
00033 public:
00034 static int valueOf(const Piece king, const Piece attacker)
00035 {
00036 return valueOf(king, attacker.ptypeO(), attacker.position());
00037 }
00038 static int valueOf(Piece king, PtypeO ptypeo, Position position)
00039 {
00040 assert(king.ptype() == KING);
00041 if (getOwner(ptypeo) == king.owner())
00042 return 0;
00043 return table.valueOf(king.position(), king.owner(),
00044 position, getPtype(ptypeo));
00045 }
00046 };
00047 }
00048 }
00049 }
00050
00051 #endif
00052
00053
00054
00055