00001
00002
00003 #ifndef _UNBLOCKABLECHECK_H
00004 #define _UNBLOCKABLECHECK_H
00005
00006 #include "osl/state/numEffectState.h"
00007 namespace osl
00008 {
00009 namespace effect_util
00010 {
00011
00012 struct UnblockableCheck
00013 {
00021 static bool isMember(Player target, const NumEffectState& state)
00022 {
00023 const Position king_position = state.getKingPosition(target);
00024 Piece attacker_piece;
00025 if (state.hasEffectBy(alt(target), king_position, attacker_piece))
00026 {
00027 if (attacker_piece == Piece::EMPTY())
00028 return true;
00029
00030
00031 const Position from = attacker_piece.position();
00032 const EffectContent effect
00033 = Ptype_Table.getEffect(attacker_piece.ptypeO(),
00034 from, king_position);
00035 return effect.hasUnblockableEffect();
00036 }
00037
00038 return false;
00039 }
00040 };
00041
00042 }
00043 }
00044
00045 #endif
00046
00047
00048
00049