00001 /* numEffectState.tcc 00002 */ 00003 #ifndef OSL_NUM_EFFECT_STATE_TCC 00004 #define OSL_NUM_EFFECT_STATE_TCC 00005 00006 #include "osl/state/numEffectState.h" 00007 #include "osl/effect/numSimpleEffect.tcc" 00008 #include "osl/checkmate/king8Info.h" 00009 00010 template <osl::Player P> 00011 bool osl::NumEffectState:: 00012 hasEffectByWithRemove(Position target,Position removed) const 00013 { 00014 const Piece piece = getPieceAt(removed); 00015 if (! piece.isPiece()) 00016 return hasEffectBy<P>(target); 00017 if (piece.owner() == P) 00018 { 00019 if (hasEffectNotBy(P, piece, target)) 00020 return true; 00021 } 00022 else 00023 { 00024 if (hasEffectBy(P, target)) 00025 return true; 00026 } 00027 if (! selectLong(removed, P).any()) 00028 return false; 00029 const Direction d = Board_Table.getLongDirection<BLACK>(Offset32(target,removed)); 00030 if (!isLong(d)) 00031 return false; 00032 const int num=longEffectNumTable()[piece.number()][longToShort(d)]; 00033 return (! Piece::isEmptyNum(num) 00034 && getPieceOf(num).owner()==P); 00035 } 00036 00037 #endif /* OSL_NUM_EFFECT_STATE_TCC */ 00038 // ;;; Local Variables: 00039 // ;;; mode:c++ 00040 // ;;; c-basic-offset:2 00041 // ;;; End: