1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-01 01:03:09 +00:00

Retire lastMove from Position class

Is not used in any way so remove.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2009-05-20 15:12:45 +02:00
parent d3c4618b3a
commit 20c2a31464
2 changed files with 14 additions and 19 deletions

View file

@ -1425,10 +1425,9 @@ void Position::do_null_move(StateInfo& backupSt) {
// Back up the information necessary to undo the null move to the supplied // Back up the information necessary to undo the null move to the supplied
// StateInfo object. In the case of a null move, the only thing we need to // StateInfo object. In the case of a null move, the only thing we need to
// remember is the last move made and the en passant square. // remember is the en passant square.
// Note that differently from normal case here backupSt is actually used as // Note that differently from normal case here backupSt is actually used as
// a backup storage not as a new state to be used. // a backup storage not as a new state to be used.
backupSt.lastMove = st->lastMove;
backupSt.epSquare = st->epSquare; backupSt.epSquare = st->epSquare;
backupSt.previous = st->previous; backupSt.previous = st->previous;
st->previous = &backupSt; st->previous = &backupSt;
@ -1462,7 +1461,6 @@ void Position::undo_null_move() {
assert(!is_check()); assert(!is_check());
// Restore information from the our backup StateInfo object // Restore information from the our backup StateInfo object
st->lastMove = st->previous->lastMove;
st->epSquare = st->previous->epSquare; st->epSquare = st->previous->epSquare;
st->previous = st->previous->previous; st->previous = st->previous->previous;

View file

@ -21,7 +21,7 @@
#if !defined(POSITION_H_INCLUDED) #if !defined(POSITION_H_INCLUDED)
#define POSITION_H_INCLUDED #define POSITION_H_INCLUDED
// Disable a silly and noisy warning from MSVC compiler // Disable some silly and noisy warning from MSVC compiler
#if defined(_MSC_VER) #if defined(_MSC_VER)
// Forcing value to bool 'true' or 'false' (performance warning) // Forcing value to bool 'true' or 'false' (performance warning)
@ -50,13 +50,12 @@
//// Constants //// Constants
//// ////
/// FEN string for the initial position: /// FEN string for the initial position
const std::string StartPosition = const std::string StartPosition = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";
"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";
/// Maximum number of plies per game (220 should be enough, because the /// Maximum number of plies per game (220 should be enough, because the
/// maximum search depth is 100, and during position setup we reset the /// maximum search depth is 100, and during position setup we reset the
/// move counter for every non-reversible move): /// move counter for every non-reversible move).
const int MaxGameLength = 220; const int MaxGameLength = 220;
@ -95,7 +94,6 @@ struct StateInfo {
PieceType capture; PieceType capture;
Bitboard checkersBB; Bitboard checkersBB;
Move lastMove;
StateInfo* previous; StateInfo* previous;
}; };
@ -104,7 +102,7 @@ struct StateInfo {
/// ///
/// * For each piece type, a bitboard representing the squares occupied /// * For each piece type, a bitboard representing the squares occupied
/// by pieces of that type. /// by pieces of that type.
/// * For each color, a bitboard representing the squares occupiecd by /// * For each color, a bitboard representing the squares occupied by
/// pieces of that color. /// pieces of that color.
/// * A bitboard of all occupied squares. /// * A bitboard of all occupied squares.
/// * A bitboard of all checking pieces. /// * A bitboard of all checking pieces.
@ -116,10 +114,9 @@ struct StateInfo {
/// * The en passant square (which is SQ_NONE if no en passant capture is /// * The en passant square (which is SQ_NONE if no en passant capture is
/// possible). /// possible).
/// * The squares of the kings for both sides. /// * The squares of the kings for both sides.
/// * The last move played.
/// * Hash keys for the position itself, the current pawn structure, and /// * Hash keys for the position itself, the current pawn structure, and
/// the current material situation. /// the current material situation.
/// * Hash keys for all previous positions in the game (for detecting /// * Hash keys for all previous positions in the game for detecting
/// repetition draws. /// repetition draws.
/// * A counter for detecting 50 move rule draws. /// * A counter for detecting 50 move rule draws.