movegen: Switch place and move generate functions

This commit is contained in:
Calcitem 2021-07-02 23:02:12 +08:00
parent 8a12e02fe2
commit ea404fc0be
1 changed files with 16 additions and 16 deletions

View File

@ -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<>