Esempio n. 1
0
template<Color Us, GenType Type> FORCE_INLINE
ExtMove* generate_all(const Position& pos, ExtMove* mlist, Bitboard target,
					  const CheckInfo* ci = NULL) {

						  const bool Checks = Type == QUIET_CHECKS;						 

						  mlist = gen_rook_moves(pos, mlist,target);
						  mlist = gen_knight_moves(pos, mlist,target);
						  mlist = gen_cannon_moves(pos, mlist,target);
						  mlist = gen_pawn_moves<Us>(pos, mlist,target);
						  mlist = gen_bishop_moves(pos, mlist,target);
						  mlist = gen_advisor_moves(pos, mlist,target);

						  if(QUIET_CHECKS != Type)
							  mlist = gen_king_moves(pos, mlist,target);

						  return mlist;

}
Esempio n. 2
0
/* Generate pseudo legal moves at START_POS and store in MOVES_ARRAY.  */
void gen_plegal_moves (int player, int start_pos, int *moves_array)
{
    switch (board[start_pos]) {
        case chp_wpawn:
            gen_wpawn_moves (start_pos, moves_array); 
            break;

        case chp_bpawn:
            gen_bpawn_moves (start_pos, moves_array);
            break;

        case chp_wknight:
        case chp_bknight:
            gen_knight_moves (player, start_pos, moves_array);
            break;

        case chp_wking:
        case chp_bking:
            gen_king_moves (player, start_pos, moves_array);
            break;

        case chp_wrook:
        case chp_brook:
            gen_rook_moves (player, start_pos, moves_array);
            break;

        case chp_wbishop:
        case chp_bbishop:
            gen_bishop_moves (player, start_pos, moves_array);
            break;

        case chp_wqueen:
        case chp_bqueen:
            gen_queen_moves (player, start_pos, moves_array);
            break;
    }
}