X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmovegen.h;h=9f45e250912602003c366f1942412edb56cbc1ff;hp=84d5d35ef70b07789f98e4149de0cf4ae3f95e41;hb=3b49aeb4f22569c2b5d5ca830858c4dd584fae7f;hpb=423c6d8a8a36fcc56d421caf0bbc12f53ba62c30 diff --git a/src/movegen.h b/src/movegen.h index 84d5d35e..9f45e250 100644 --- a/src/movegen.h +++ b/src/movegen.h @@ -46,6 +46,10 @@ struct MoveList { bool end() const { return cur == last; } Move move() const { return cur->move; } size_t size() const { return last - mlist; } + bool contains(Move m) const { + for (const MoveStack* it(mlist) ; it != last; ++it) if (it->move == m) return true; + return false; + } private: MoveStack mlist[MAX_MOVES];