Pass CastlingFlag argument only

Instead of Color and CastlingSide. Change functions API
accordingly.

No functional change.
This commit is contained in:
Marco Costalba
2014-03-02 11:53:17 +01:00
parent 3e5470d88f
commit 708cb311a0
5 changed files with 51 additions and 47 deletions

View File

@@ -291,10 +291,10 @@ Score Entry::update_safety(const Position& pos, Square ksq) {
Value bonus = shelter_storm<Us>(pos, ksq);
// If we can castle use the bonus after the castling if it is bigger
if (pos.can_castle(make_castling_flag(Us, KING_SIDE)))
if (pos.can_castle(MakeCastling<Us, KING_SIDE>::flag))
bonus = std::max(bonus, shelter_storm<Us>(pos, relative_square(Us, SQ_G1)));
if (pos.can_castle(make_castling_flag(Us, QUEEN_SIDE)))
if (pos.can_castle(MakeCastling<Us, QUEEN_SIDE>::flag))
bonus = std::max(bonus, shelter_storm<Us>(pos, relative_square(Us, SQ_C1)));
return kingSafety[Us] = make_score(bonus, -16 * minKPdistance[Us]);