]> git.sesse.net Git - stockfish/blobdiff - src/position.cpp
Simplify generate_pawn_captures()
[stockfish] / src / position.cpp
index b5503cb501fbbcac919ae542231942203ec8f2eb..6abef5b47bcb42c764901fdc0cb7a871d7e80039 100644 (file)
@@ -57,7 +57,26 @@ Key Position::zobExclusion;
 
 Score Position::PieceSquareTable[16][64];
 
-// Material values used by SEE, indexed by PieceType
+// Material values arrays, indexed by Piece
+const Value Position::PieceValueMidgame[17] = {
+  VALUE_ZERO,
+  PawnValueMidgame, KnightValueMidgame, BishopValueMidgame,
+  RookValueMidgame, QueenValueMidgame, VALUE_ZERO,
+  VALUE_ZERO, VALUE_ZERO,
+  PawnValueMidgame, KnightValueMidgame, BishopValueMidgame,
+  RookValueMidgame, QueenValueMidgame
+};
+
+const Value Position::PieceValueEndgame[17] = {
+  VALUE_ZERO,
+  PawnValueEndgame, KnightValueEndgame, BishopValueEndgame,
+  RookValueEndgame, QueenValueEndgame, VALUE_ZERO,
+  VALUE_ZERO, VALUE_ZERO,
+  PawnValueEndgame, KnightValueEndgame, BishopValueEndgame,
+  RookValueEndgame, QueenValueEndgame
+};
+
+// Material values array used by SEE, indexed by PieceType
 const Value Position::seeValues[] = {
     VALUE_ZERO,
     PawnValueMidgame, KnightValueMidgame, BishopValueMidgame,