movegen: Switch place and move generate functions
This commit is contained in:
parent
8a12e02fe2
commit
ea404fc0be
|
@ -20,22 +20,6 @@
|
||||||
#include "position.h"
|
#include "position.h"
|
||||||
#include "mills.h"
|
#include "mills.h"
|
||||||
|
|
||||||
/// generate<PLACE> generates all places.
|
|
||||||
/// Returns a pointer to the end of the move list.
|
|
||||||
template<>
|
|
||||||
ExtMove *generate<PLACE>(Position &pos, ExtMove *moveList)
|
|
||||||
{
|
|
||||||
ExtMove *cur = moveList;
|
|
||||||
|
|
||||||
for (auto s : MoveList<LEGAL>::movePriorityList) {
|
|
||||||
if (!pos.get_board()[s]) {
|
|
||||||
*cur++ = (Move)s;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return cur;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// generate<MOVE> generates all moves.
|
/// generate<MOVE> generates all moves.
|
||||||
/// Returns a pointer to the end of the move moves.
|
/// Returns a pointer to the end of the move moves.
|
||||||
template<>
|
template<>
|
||||||
|
@ -72,6 +56,22 @@ ExtMove *generate<MOVE>(Position &pos, ExtMove *moveList)
|
||||||
return cur;
|
return cur;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// generate<PLACE> generates all places.
|
||||||
|
/// Returns a pointer to the end of the move list.
|
||||||
|
template<>
|
||||||
|
ExtMove *generate<PLACE>(Position &pos, ExtMove *moveList)
|
||||||
|
{
|
||||||
|
ExtMove *cur = moveList;
|
||||||
|
|
||||||
|
for (auto s : MoveList<LEGAL>::movePriorityList) {
|
||||||
|
if (!pos.get_board()[s]) {
|
||||||
|
*cur++ = (Move)s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return cur;
|
||||||
|
}
|
||||||
|
|
||||||
/// generate<REMOVE> generates all removes.
|
/// generate<REMOVE> generates all removes.
|
||||||
/// Returns a pointer to the end of the move moves.
|
/// Returns a pointer to the end of the move moves.
|
||||||
template<>
|
template<>
|
||||||
|
|
Loading…
Reference in New Issue