mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 00:33:09 +00:00
Small code style in headers
No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
b98bcf858b
commit
d3c4618b3a
7 changed files with 19 additions and 20 deletions
|
@ -65,7 +65,7 @@ enum EndgameType {
|
|||
template<typename T>
|
||||
class EndgameFunctionBase {
|
||||
public:
|
||||
EndgameFunctionBase(Color c) : strongerSide(c) { weakerSide = opposite_color(strongerSide); }
|
||||
EndgameFunctionBase(Color c) : strongerSide(c), weakerSide(opposite_color(c)) {}
|
||||
virtual ~EndgameFunctionBase() {}
|
||||
virtual T apply(const Position&) = 0;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
/// arguments to the evaluation function, and the search can make use of its
|
||||
/// contents to make intelligent search decisions.
|
||||
///
|
||||
/// At the moment, this is not utilized very much: The only part of the
|
||||
/// At the moment, this is not utilized very much: The only part of the
|
||||
/// EvalInfo object which is used by the search is futilityMargin.
|
||||
class Position;
|
||||
|
||||
|
@ -53,16 +53,16 @@ struct EvalInfo {
|
|||
PawnInfo* pi;
|
||||
|
||||
// attackedBy[color][piece type] is a bitboard representing all squares
|
||||
// attacked by a given color and piece type. attackedBy[color][0] contains
|
||||
// attacked by a given color and piece type, attackedBy[color][0] contains
|
||||
// all squares attacked by the given color.
|
||||
Bitboard attackedBy[2][8];
|
||||
Bitboard attacked_by(Color c) const { return attackedBy[c][0]; }
|
||||
Bitboard attacked_by(Color c, PieceType pt) const { return attackedBy[c][pt]; }
|
||||
|
||||
// kingZone[color] is the zone around the enemy king which is considered
|
||||
// by the king safety evaluation. This consists of the squares directly
|
||||
// by the king safety evaluation. This consists of the squares directly
|
||||
// adjacent to the king, and the three (or two, for a king on an edge file)
|
||||
// squares two ranks in front of the king. For instance, if black's king
|
||||
// squares two ranks in front of the king. For instance, if black's king
|
||||
// is on g8, kingZone[WHITE] is a bitboard containing the squares f8, h8,
|
||||
// f7, g7, h7, f6, g6 and h6.
|
||||
Bitboard kingZone[2];
|
||||
|
@ -91,7 +91,7 @@ struct EvalInfo {
|
|||
// Middle game and endgame mobility scores.
|
||||
Value mgMobility, egMobility;
|
||||
|
||||
// Extra futility margin. This is added to the standard futility margin
|
||||
// Extra futility margin. This is added to the standard futility margin
|
||||
// in the quiescence search.
|
||||
Value futilityMargin;
|
||||
};
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
|
||||
// x86 assembly language locks or OS spin locks may perform faster than
|
||||
// mutex locks on some platforms. On my machine, mutexes seem to be the
|
||||
// mutex locks on some platforms. On my machine, mutexes seem to be the
|
||||
// best.
|
||||
|
||||
//#define ASM_LOCK
|
||||
|
|
|
@ -129,7 +129,7 @@ inline void MaterialInfo::clear() {
|
|||
|
||||
|
||||
/// MaterialInfo::scale_factor takes a position and a color as input, and
|
||||
/// returns a scale factor for the given color. We have to provide the
|
||||
/// returns a scale factor for the given color. We have to provide the
|
||||
/// position in addition to the color, because the scale factor need not
|
||||
/// to be a constant: It can also be a function which should be applied to
|
||||
/// the position. For instance, in KBP vs K endgames, a scaling function
|
||||
|
@ -167,7 +167,7 @@ inline bool MaterialInfo::specialized_eval_exists() const {
|
|||
|
||||
|
||||
/// MaterialInfo::evaluate applies a specialized evaluation function
|
||||
/// to a given position object. It should only be called when
|
||||
/// to a given position object. It should only be called when
|
||||
/// specialized_eval_exists() returns 'true'.
|
||||
|
||||
inline Value MaterialInfo::evaluate(const Position& pos) const {
|
||||
|
|
|
@ -119,7 +119,7 @@ inline Move make_ep_move(Square from, Square to) {
|
|||
//// Prototypes
|
||||
////
|
||||
|
||||
extern std::ostream &operator << (std::ostream &os, Move m);
|
||||
extern std::ostream& operator<<(std::ostream &os, Move m);
|
||||
extern Move move_from_string(const Position &pos, const std::string &str);
|
||||
extern const std::string move_to_string(Move m);
|
||||
extern bool move_is_ok(Move m);
|
||||
|
|
|
@ -40,8 +40,8 @@ struct SearchStack;
|
|||
extern SearchStack EmptySearchStack;
|
||||
|
||||
/// MovePicker is a class which is used to pick one legal move at a time from
|
||||
/// the current position. It is initialized with a Position object and a few
|
||||
/// moves we have reason to believe are good. The most important method is
|
||||
/// the current position. It is initialized with a Position object and a few
|
||||
/// moves we have reason to believe are good. The most important method is
|
||||
/// MovePicker::pick_next_move(), which returns a new legal move each time it
|
||||
/// is called, until there are no legal moves left, when MOVE_NONE is returned.
|
||||
/// In order to improve the efficiency of the alpha beta algorithm, MovePicker
|
||||
|
@ -49,7 +49,7 @@ extern SearchStack EmptySearchStack;
|
|||
|
||||
class MovePicker {
|
||||
|
||||
MovePicker& operator=(const MovePicker&); // Silence a warning under MSVC
|
||||
MovePicker& operator=(const MovePicker&); // silence a warning under MSVC
|
||||
|
||||
public:
|
||||
|
||||
|
@ -63,15 +63,14 @@ public:
|
|||
PH_NONCAPTURES, // Non-captures and underpromotions
|
||||
PH_EVASIONS, // Check evasions
|
||||
PH_QCAPTURES, // Captures in quiescence search
|
||||
PH_QCHECKS, // Checks in quiescence search
|
||||
PH_QCHECKS, // Non-capture checks in quiescence search
|
||||
PH_STOP
|
||||
};
|
||||
|
||||
MovePicker(const Position& p, bool pvnode, Move ttm, const SearchStack& ss, Depth d);
|
||||
Move get_next_move();
|
||||
Move get_next_move(Lock &lock);
|
||||
Move get_next_move(Lock& lock);
|
||||
int number_of_moves() const;
|
||||
int current_move_score() const;
|
||||
Bitboard discovered_check_candidates() const;
|
||||
|
||||
static void init_phase_table();
|
||||
|
@ -110,7 +109,7 @@ inline int MovePicker::number_of_moves() const {
|
|||
}
|
||||
|
||||
/// MovePicker::discovered_check_candidates() returns a bitboard containing
|
||||
/// all pieces which can possibly give discovered check. This bitboard is
|
||||
/// all pieces which can possibly give discovered check. This bitboard is
|
||||
/// computed by the constructor function.
|
||||
|
||||
inline Bitboard MovePicker::discovered_check_candidates() const {
|
||||
|
|
|
@ -33,9 +33,9 @@
|
|||
////
|
||||
|
||||
/// PawnInfo is a class which contains various information about a pawn
|
||||
/// structure. Currently, it only includes a middle game and an end game
|
||||
/// pawn structure evaluation, and a bitboard of passed pawns. We may want
|
||||
/// to add further information in the future. A lookup to the pawn hash table
|
||||
/// structure. Currently, it only includes a middle game and an end game
|
||||
/// pawn structure evaluation, and a bitboard of passed pawns. We may want
|
||||
/// to add further information in the future. A lookup to the pawn hash table
|
||||
/// (performed by calling the get_pawn_info method in a PawnInfoTable object)
|
||||
/// returns a pointer to a PawnInfo object.
|
||||
class Position;
|
||||
|
|
Loading…
Add table
Reference in a new issue