]> git.sesse.net Git - stockfish/blobdiff - src/position.cpp
Introduce operator~(Piece c)
[stockfish] / src / position.cpp
index d145ddfa0def3ae65959b0593667a6ad2e34e466..2227c553ca6c7a79c1e5f50e8e588ce359ddc618 100644 (file)
@@ -85,17 +85,17 @@ void init() {
   side = rk.rand<Key>();
   exclusion  = rk.rand<Key>();
 
   side = rk.rand<Key>();
   exclusion  = rk.rand<Key>();
 
-  for (PieceType pt = PAWN; pt <= KING; pt++)
+  for (Piece pc = W_PAWN; pc <= W_KING; pc++)
   {
   {
-      PieceValue[MG][make_piece(BLACK, pt)] = PieceValue[MG][pt];
-      PieceValue[EG][make_piece(BLACK, pt)] = PieceValue[EG][pt];
+      PieceValue[MG][~pc] = PieceValue[MG][pc];
+      PieceValue[EG][~pc] = PieceValue[EG][pc];
 
 
-      Score v = make_score(PieceValue[MG][pt], PieceValue[EG][pt]);
+      Score v = make_score(PieceValue[MG][pc], PieceValue[EG][pc]);
 
       for (Square s = SQ_A1; s <= SQ_H8; s++)
       {
 
       for (Square s = SQ_A1; s <= SQ_H8; s++)
       {
-          pieceSquareTable[make_piece(WHITE, pt)][ s] =  (v + PSQT[pt][s]);
-          pieceSquareTable[make_piece(BLACK, pt)][~s] = -(v + PSQT[pt][s]);
+          pieceSquareTable[ pc][ s] =  (v + PSQT[pc][s]);
+          pieceSquareTable[~pc][~s] = -(v + PSQT[pc][s]);
       }
   }
 }
       }
   }
 }