00001 /* proofPiecesUtil.h 00002 */ 00003 #ifndef OSL_PROOFPIECESUTIL_H 00004 #define OSL_PROOFPIECESUTIL_H 00005 00006 #include "osl/numEffectState.h" 00007 00008 namespace osl 00009 { 00010 namespace checkmate 00011 { 00012 class CheckMoveList; 00016 struct ProofPiecesUtil 00017 { 00022 static 00023 void addMonopolizedPieces(const SimpleState& state, Player player, 00024 const PieceStand max, PieceStand& out) 00025 { 00026 const Player opponent = alt(player); 00027 for (Ptype ptype: PieceStand::order) 00028 { 00029 if (! state.hasPieceOnStand(opponent, ptype)) 00030 { 00031 const int diff = max.get(ptype) - out.get(ptype); 00032 assert(diff >= 0); 00033 if (diff) 00034 out.add(ptype, diff); 00035 } 00036 } 00037 } 00038 }; 00039 } // namespace checkmate 00040 } // osl 00041 00042 #endif /* OSL_PROOFPIECESUTIL_H */ 00043 // ;;; Local Variables: 00044 // ;;; mode:c++ 00045 // ;;; c-basic-offset:2 00046 // ;;; End: