]> git.sesse.net Git - stockfish/blobdiff - src/position.h
Use string instead of std::string
[stockfish] / src / position.h
index d2b37478e4ce681714fc11b654986da82a016209..2a95234585f7c60579d2aaec468906a2c7d12832 100644 (file)
@@ -1,7 +1,7 @@
 /*
   Stockfish, a UCI chess playing engine derived from Glaurung 2.1
   Copyright (C) 2004-2008 Tord Romstad (Glaurung author)
-  Copyright (C) 2008 Marco Costalba
+  Copyright (C) 2008-2009 Marco Costalba
 
   Stockfish is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -718,5 +718,11 @@ inline bool Position::has_pawn_on_7th(Color c) const {
   return pawns(c) & relative_rank_bb(c, RANK_7);
 }
 
+inline bool Position::move_is_capture(Move m) const {
+
+  // Move must not be MOVE_NONE !
+
+  return (!square_is_empty(move_to(m)) && !move_is_castle(m)) || move_is_ep(m);
+}
 
 #endif // !defined(POSITION_H_INCLUDED)