All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
numEffectState.tcc
Go to the documentation of this file.
1 /* numEffectState.tcc
2  */
3 #ifndef OSL_NUM_EFFECT_STATE_TCC
4 #define OSL_NUM_EFFECT_STATE_TCC
5 
9 
10 template <osl::Player P>
11 bool osl::NumEffectState::
12 hasEffectByWithRemove(Square target,Square removed) const
13 {
14  const Piece piece = pieceAt(removed);
15  if (! piece.isPiece())
16  return hasEffectAt<P>(target);
17  if (piece.owner() == P)
18  {
19  if (hasEffectNotBy(P, piece, target))
20  return true;
21  }
22  else
23  {
24  if (hasEffectAt(P, target))
25  return true;
26  }
27  if (! longEffectAt(removed, P).any())
28  return false;
29  const Direction d = Board_Table.getLongDirection<BLACK>(Offset32(target,removed));
30  if (!isLong(d))
31  return false;
32  const int num=longEffectNumTable()[piece.number()][longToShort(d)];
33  return (! Piece::isEmptyNum(num)
34  && pieceOf(num).owner()==P);
35 }
36 
37 #endif /* OSL_NUM_EFFECT_STATE_TCC */
38 // ;;; Local Variables:
39 // ;;; mode:c++
40 // ;;; c-basic-offset:2
41 // ;;; End: