#ifndef MOVEGEN_H_INCLUDED
#define MOVEGEN_H_INCLUDED
+#include <algorithm>
+
#include "types.h"
class Position;
struct ExtMove {
Move move;
- Value value;
+ int value;
operator Move() const { return move; }
void operator=(Move m) { move = m; }
const ExtMove* end() const { return last; }
size_t size() const { return last - moveList; }
bool contains(Move move) const {
- for (const auto& m : *this) if (m == move) return true;
- return false;
+ return std::find(begin(), end(), move) != end();
}
private: