mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
Use namespace in position.cpp
No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
b06f0460a2
commit
da6e2b5fd1
2 changed files with 46 additions and 43 deletions
|
@ -44,9 +44,35 @@ using std::string;
|
||||||
using std::cout;
|
using std::cout;
|
||||||
using std::endl;
|
using std::endl;
|
||||||
|
|
||||||
static inline bool isZero(char c) { return c == '0'; }
|
|
||||||
|
|
||||||
struct PieceLetters : public std::map<char, Piece> {
|
////
|
||||||
|
//// Position's static data definitions
|
||||||
|
////
|
||||||
|
|
||||||
|
Key Position::zobrist[2][8][64];
|
||||||
|
Key Position::zobEp[64];
|
||||||
|
Key Position::zobCastle[16];
|
||||||
|
Key Position::zobSideToMove;
|
||||||
|
Key Position::zobExclusion;
|
||||||
|
|
||||||
|
Score Position::PieceSquareTable[16][64];
|
||||||
|
|
||||||
|
// Material values used by SEE, indexed by PieceType
|
||||||
|
const Value Position::seeValues[] = {
|
||||||
|
VALUE_ZERO,
|
||||||
|
PawnValueMidgame, KnightValueMidgame, BishopValueMidgame,
|
||||||
|
RookValueMidgame, QueenValueMidgame, QueenValueMidgame*10
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
// Bonus for having the side to move (modified by Joona Kiiski)
|
||||||
|
const Score TempoValue = make_score(48, 22);
|
||||||
|
|
||||||
|
bool isZero(char c) { return c == '0'; }
|
||||||
|
|
||||||
|
struct PieceLetters : public std::map<char, Piece> {
|
||||||
|
|
||||||
PieceLetters() {
|
PieceLetters() {
|
||||||
|
|
||||||
|
@ -69,36 +95,11 @@ struct PieceLetters : public std::map<char, Piece> {
|
||||||
assert(false);
|
assert(false);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
};
|
} pieceLetters;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
////
|
/// CheckInfo c'tor
|
||||||
//// Constants and variables
|
|
||||||
////
|
|
||||||
|
|
||||||
/// Bonus for having the side to move (modified by Joona Kiiski)
|
|
||||||
|
|
||||||
static const Score TempoValue = make_score(48, 22);
|
|
||||||
|
|
||||||
|
|
||||||
Key Position::zobrist[2][8][64];
|
|
||||||
Key Position::zobEp[64];
|
|
||||||
Key Position::zobCastle[16];
|
|
||||||
Key Position::zobSideToMove;
|
|
||||||
Key Position::zobExclusion;
|
|
||||||
|
|
||||||
Score Position::PieceSquareTable[16][64];
|
|
||||||
|
|
||||||
static PieceLetters pieceLetters;
|
|
||||||
|
|
||||||
// Material values used by SEE, indexed by PieceType
|
|
||||||
const Value Position::seeValues[] = {
|
|
||||||
VALUE_ZERO, PawnValueMidgame, KnightValueMidgame, BishopValueMidgame,
|
|
||||||
RookValueMidgame, QueenValueMidgame, QueenValueMidgame*10
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/// Constructors
|
|
||||||
|
|
||||||
CheckInfo::CheckInfo(const Position& pos) {
|
CheckInfo::CheckInfo(const Position& pos) {
|
||||||
|
|
||||||
|
|
28
src/psqtab.h
28
src/psqtab.h
|
@ -27,18 +27,25 @@
|
||||||
|
|
||||||
#include "value.h"
|
#include "value.h"
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
////
|
////
|
||||||
//// Constants modified by Joona Kiiski
|
//// Constants modified by Joona Kiiski
|
||||||
////
|
////
|
||||||
|
|
||||||
static const Value MP = PawnValueMidgame;
|
const Value MP = PawnValueMidgame;
|
||||||
static const Value MK = KnightValueMidgame;
|
const Value MK = KnightValueMidgame;
|
||||||
static const Value MB = BishopValueMidgame;
|
const Value MB = BishopValueMidgame;
|
||||||
static const Value MR = RookValueMidgame;
|
const Value MR = RookValueMidgame;
|
||||||
static const Value MQ = QueenValueMidgame;
|
const Value MQ = QueenValueMidgame;
|
||||||
|
|
||||||
static const int MgPST[][64] = {
|
const Value EP = PawnValueEndgame;
|
||||||
|
const Value EK = KnightValueEndgame;
|
||||||
|
const Value EB = BishopValueEndgame;
|
||||||
|
const Value ER = RookValueEndgame;
|
||||||
|
const Value EQ = QueenValueEndgame;
|
||||||
|
|
||||||
|
const int MgPST[][64] = {
|
||||||
{ },
|
{ },
|
||||||
{// Pawn
|
{// Pawn
|
||||||
// A B C D E F G H
|
// A B C D E F G H
|
||||||
|
@ -108,13 +115,7 @@ static const int MgPST[][64] = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static const Value EP = PawnValueEndgame;
|
const int EgPST[][64] = {
|
||||||
static const Value EK = KnightValueEndgame;
|
|
||||||
static const Value EB = BishopValueEndgame;
|
|
||||||
static const Value ER = RookValueEndgame;
|
|
||||||
static const Value EQ = QueenValueEndgame;
|
|
||||||
|
|
||||||
static const int EgPST[][64] = {
|
|
||||||
{ },
|
{ },
|
||||||
{// Pawn
|
{// Pawn
|
||||||
// A B C D E F G H
|
// A B C D E F G H
|
||||||
|
@ -184,5 +185,6 @@ static const int EgPST[][64] = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
#endif // !defined(PSQTAB_H_INCLUDED)
|
#endif // !defined(PSQTAB_H_INCLUDED)
|
||||||
|
|
Loading…
Add table
Reference in a new issue