Use type_of() to categorize the moves

Needed to rename old MoveType (used in move generation)
to GenType.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2012-06-24 10:08:16 +01:00
parent 7b4aa10708
commit dc7fd868f4
11 changed files with 113 additions and 117 deletions

View File

@@ -22,23 +22,23 @@
#include "types.h"
enum MoveType {
MV_CAPTURE,
MV_QUIET,
MV_QUIET_CHECK,
MV_EVASION,
MV_NON_EVASION,
MV_LEGAL
enum GenType {
CAPTURES,
QUIETS,
QUIET_CHECKS,
EVASIONS,
NON_EVASIONS,
LEGAL
};
class Position;
template<MoveType>
template<GenType>
MoveStack* generate(const Position& pos, MoveStack* mlist);
/// The MoveList struct is a simple wrapper around generate(), sometimes comes
/// handy to use this class instead of the low level generate() function.
template<MoveType T>
template<GenType T>
struct MoveList {
explicit MoveList(const Position& pos) : cur(mlist), last(generate<T>(pos, mlist)) {}