| 1 |
/* proofPieces.cc |
| 2 |
*/ |
| 3 |
#include "osl/checkmate/proofPieces.h" |
| 4 |
#include "checkMoveList.h" |
| 5 |
#include "checkHashRecord.h" |
| 6 |
|
| 7 |
const osl::PieceStand osl::checkmate:: |
| 8 |
ProofPieces::defense(const CheckMoveList& moves, const NumEffectState& state, |
| 9 |
PieceStand max) |
| 10 |
{ |
| 11 |
CheckMoveList::const_iterator p=moves.begin(); |
| 12 |
assert(p != moves.end()); |
| 13 |
assert(p->record); |
| 14 |
PieceStand result = p->record->proofPieces(); |
| 15 |
++p; |
| 16 |
for (; p!=moves.end(); ++p) |
| 17 |
{ |
| 18 |
assert(p->record); |
| 19 |
result = result.max(p->record->proofPieces()); |
| 20 |
} |
| 21 |
const Player defender = state.turn(); |
| 22 |
if (! effect_util::UnblockableCheck::isMember(defender, state)) |
| 23 |
ProofPiecesUtil::addMonopolizedPieces(state, alt(defender), max, |
| 24 |
result); |
| 25 |
return result; |
| 26 |
} |
| 27 |
|
| 28 |
/* ------------------------------------------------------------------------- */ |
| 29 |
// ;;; Local Variables: |
| 30 |
// ;;; mode:c++ |
| 31 |
// ;;; c-basic-offset:2 |
| 32 |
// ;;; End: |