mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 00:56:39 +08:00
Rename AttackWeight[] in KingAttackWeights[]
Also simplify a bit the code removing useless named constants. No functional change.
This commit is contained in:
@@ -203,13 +203,8 @@ namespace {
|
|||||||
/// the strength of the enemy attack are added up into an integer, which
|
/// the strength of the enemy attack are added up into an integer, which
|
||||||
/// is used as an index to KingDangerTable[].
|
/// is used as an index to KingDangerTable[].
|
||||||
|
|
||||||
// Attack weights for each piece type and table indexed on piece type
|
// KingAttackWeights[] contains king attack weights by piece type
|
||||||
const int QueenAttackWeight = 5;
|
const int KingAttackWeights[8] = { 0, 0, 2, 2, 3, 5 };
|
||||||
const int RookAttackWeight = 3;
|
|
||||||
const int BishopAttackWeight = 2;
|
|
||||||
const int KnightAttackWeight = 2;
|
|
||||||
|
|
||||||
const int AttackWeight[] = { 0, 0, KnightAttackWeight, BishopAttackWeight, RookAttackWeight, QueenAttackWeight };
|
|
||||||
|
|
||||||
// Bonuses for enemy's safe checks
|
// Bonuses for enemy's safe checks
|
||||||
const int QueenContactCheckBonus = 3;
|
const int QueenContactCheckBonus = 3;
|
||||||
@@ -554,7 +549,7 @@ namespace {
|
|||||||
if (b & ei.kingZone[Us])
|
if (b & ei.kingZone[Us])
|
||||||
{
|
{
|
||||||
ei.kingAttackersCount[Us]++;
|
ei.kingAttackersCount[Us]++;
|
||||||
ei.kingAttackersWeight[Us] += AttackWeight[Piece];
|
ei.kingAttackersWeight[Us] += KingAttackWeights[Piece];
|
||||||
Bitboard bb = (b & ei.attackedBy[Them][KING]);
|
Bitboard bb = (b & ei.attackedBy[Them][KING]);
|
||||||
if (bb)
|
if (bb)
|
||||||
ei.kingAdjacentZoneAttacksCount[Us] += count_1s_max_15<HasPopCnt>(bb);
|
ei.kingAdjacentZoneAttacksCount[Us] += count_1s_max_15<HasPopCnt>(bb);
|
||||||
|
|||||||
Reference in New Issue
Block a user