movegen: Switch place and move generate functions
This commit is contained in:
parent
8a12e02fe2
commit
ea404fc0be
|
@ -20,22 +20,6 @@
|
|||
#include "position.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.
|
||||
/// Returns a pointer to the end of the move moves.
|
||||
template<>
|
||||
|
@ -72,6 +56,22 @@ ExtMove *generate<MOVE>(Position &pos, ExtMove *moveList)
|
|||
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.
|
||||
/// Returns a pointer to the end of the move moves.
|
||||
template<>
|
||||
|
|
Loading…
Reference in New Issue