From ea404fc0befdca90ad5c4bafe07adaa0adaf3417 Mon Sep 17 00:00:00 2001 From: Calcitem Date: Fri, 2 Jul 2021 23:02:12 +0800 Subject: [PATCH] movegen: Switch place and move generate functions --- src/movegen.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/movegen.cpp b/src/movegen.cpp index eb5055f3..40c7281d 100644 --- a/src/movegen.cpp +++ b/src/movegen.cpp @@ -20,22 +20,6 @@ #include "position.h" #include "mills.h" -/// generate generates all places. -/// Returns a pointer to the end of the move list. -template<> -ExtMove *generate(Position &pos, ExtMove *moveList) -{ - ExtMove *cur = moveList; - - for (auto s : MoveList::movePriorityList) { - if (!pos.get_board()[s]) { - *cur++ = (Move)s; - } - } - - return cur; -} - /// generate generates all moves. /// Returns a pointer to the end of the move moves. template<> @@ -72,6 +56,22 @@ ExtMove *generate(Position &pos, ExtMove *moveList) return cur; } +/// generate generates all places. +/// Returns a pointer to the end of the move list. +template<> +ExtMove *generate(Position &pos, ExtMove *moveList) +{ + ExtMove *cur = moveList; + + for (auto s : MoveList::movePriorityList) { + if (!pos.get_board()[s]) { + *cur++ = (Move)s; + } + } + + return cur; +} + /// generate generates all removes. /// Returns a pointer to the end of the move moves. template<>