]> git.sesse.net Git - stockfish/commitdiff
Add Null move support to MovePicker.
authorJoona Kiiski <joona.kiiski@gmail.com>
Mon, 24 Aug 2009 15:00:35 +0000 (18:00 +0300)
committerMarco Costalba <mcostalba@gmail.com>
Wed, 26 Aug 2009 15:29:18 +0000 (16:29 +0100)
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/movepick.cpp
src/movepick.h

index 0b887c99d0afb31abc3c963e7645a4224d082d3a..f50f16b03b2ac9fbfd5c2f20d875fce22f1067e1 100644 (file)
@@ -43,7 +43,7 @@ namespace {
   /// Variables
 
   CACHE_LINE_ALIGNMENT
-  const MovegenPhaseT MainSearchPhaseTable[] = { PH_STOP, PH_TT_MOVES, PH_GOOD_CAPTURES, PH_KILLERS, PH_NONCAPTURES, PH_BAD_CAPTURES, PH_STOP};
+  const MovegenPhaseT MainSearchPhaseTable[] = { PH_STOP, PH_NULL_MOVE, PH_TT_MOVES, PH_GOOD_CAPTURES, PH_KILLERS, PH_NONCAPTURES, PH_BAD_CAPTURES, PH_STOP};
   const MovegenPhaseT EvasionsPhaseTable[] = { PH_STOP, PH_EVASIONS, PH_STOP};
   const MovegenPhaseT QsearchWithChecksPhaseTable[] = { PH_STOP, PH_TT_MOVES, PH_QCAPTURES, PH_QCHECKS, PH_STOP};
   const MovegenPhaseT QsearchWithoutChecksPhaseTable[] = { PH_STOP, PH_TT_MOVES, PH_QCAPTURES, PH_STOP};
@@ -63,7 +63,7 @@ namespace {
 /// move ordering is at the current node.
 
 MovePicker::MovePicker(const Position& p, Move ttm, Depth d,
-                       const History& h, SearchStack* ss) : pos(p), H(h) {
+                       const History& h, SearchStack* ss, bool useNullMove) : pos(p), H(h) {
   ttMoves[0] = ttm;
   if (ss)
   {
@@ -115,6 +115,9 @@ Move MovePicker::get_next_move() {
     phasePtr++;
     switch (*phasePtr) {
 
+    case PH_NULL_MOVE:
+        break;
+
     case PH_TT_MOVES:
         movesPicked = 0; // This is used as index to ttMoves[]
         break;
index a5ecb0662015edf7cb01d98dd506327e2031405b..46cf69ddce30ec4f51f51b83f92b04d740d0e4e5 100644 (file)
@@ -38,6 +38,7 @@
 struct SearchStack;
 
 enum MovegenPhase {
+  PH_NULL_MOVE,      // Null move
   PH_TT_MOVES,       // Transposition table move and mate killer
   PH_GOOD_CAPTURES,  // Queen promotions and captures with SEE values >= 0
   PH_KILLERS,        // Killer moves from the current ply
@@ -64,7 +65,7 @@ class MovePicker {
   MovePicker& operator=(const MovePicker&); // silence a warning under MSVC
 
 public:
-  MovePicker(const Position& p, Move ttm, Depth d, const History& h, SearchStack* ss = NULL);
+  MovePicker(const Position& p, Move ttm, Depth d, const History& h, SearchStack* ss = NULL, bool useNullMove = false);
   Move get_next_move();
   Move get_next_move(Lock& lock);
   int number_of_moves() const;