Passing UndoInfo is not needed anymore when undoing the move

We store it now in the same UndoInfo struct as 'previous'
field, so when doing a move we also know where to get
the previous info when undoing the back the move.

This is needed for future patches and is a nice cleanup anyway.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2009-02-22 17:49:52 +01:00
parent 1b0fee9b17
commit 9b257ba29d
3 changed files with 24 additions and 24 deletions

View File

@@ -87,6 +87,7 @@ struct UndoInfo {
Move lastMove;
Value mgValue, egValue;
PieceType capture;
UndoInfo* previous;
};
@@ -241,7 +242,7 @@ public:
// Doing and undoing moves
void do_move(Move m, UndoInfo &u);
void undo_move(Move m, const UndoInfo &u);
void undo_move(Move m);
void do_null_move(UndoInfo &u);
void undo_null_move(const UndoInfo &u);
@@ -296,10 +297,10 @@ private:
// Helper functions for doing and undoing moves
void do_capture_move(Move m, PieceType capture, Color them, Square to);
void do_castle_move(Move m);
void do_promotion_move(Move m, UndoInfo &u);
void do_promotion_move(Move m);
void do_ep_move(Move m);
void undo_castle_move(Move m);
void undo_promotion_move(Move m, const UndoInfo &u);
void undo_promotion_move(Move m);
void undo_ep_move(Move m);
void find_checkers();
@@ -356,6 +357,7 @@ private:
Move lastMove;
Value mgValue, egValue;
PieceType capture;
UndoInfo* previous;
};
};