Go to the documentation of this file.00001
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(Square target,Square removed) const
00013 {
00014 const Piece piece = pieceAt(removed);
00015 if (! piece.isPiece())
00016 return hasEffectAt<P>(target);
00017 if (piece.owner() == P)
00018 {
00019 if (hasEffectNotBy(P, piece, target))
00020 return true;
00021 }
00022 else
00023 {
00024 if (hasEffectAt(P, target))
00025 return true;
00026 }
00027 if (! longEffectAt(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 && pieceOf(num).owner()==P);
00035 }
00036
00037 #endif
00038
00039
00040
00041