directCheck.h
Go to the documentation of this file.
/* directCheck.h
*/
#ifndef OSL_MOVE_CLASSIFIER_DIRECTCHECK_H
#define OSL_MOVE_CLASSIFIER_DIRECTCHECK_H
#include "osl/basic_type.h"
namespace osl
{
namespace move_classifier
{
template <Player P>
struct DirectCheck
{
static bool isMember(const NumEffectState& state, Ptype ptype, Square to)
{
assert(!state.template hasEffectAt<P>(state.template kingSquare<alt(P)>()));
return state.hasEffectIf(newPtypeO(P,ptype),to,
state.template kingSquare<alt(P)>());
}
template<class State>
static bool isMember(const State& state, Ptype ptype, Square /*from*/, Square to)
{
return isMember(state, ptype, to);
}
};
} // namespace move_classifier
} // namespace osl
#endif /* _DIRECTCHECK_H */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
basic_type.h
osl::NumEffectState
利きを持つ局面
Definition numEffectState.h:34
osl::NumEffectState::hasEffectIf
bool hasEffectIf(PtypeO ptypeo, Square attacker, Square target) const
attackerにptypeoの駒がいると仮定した場合にtargetに利きがあるかどうか を stateをupdateしないで確かめる.
Definition numEffectState.h:465
osl::Square
Definition basic_type.h:532
osl::move_classifier
Definition check_.h:10
osl
Definition additionalEffect.h:6
osl::Ptype
Ptype
駒の種類を4ビットでコード化する
Definition basic_type.h:84
osl::alt
constexpr Player alt(Player player)
Definition basic_type.h:13
osl::newPtypeO
PtypeO newPtypeO(Player player, Ptype ptype)
Definition basic_type.h:211
osl::move_classifier::DirectCheck
Definition directCheck.h:14
osl::move_classifier::DirectCheck::isMember
static bool isMember(const State &state, Ptype ptype, Square, Square to)
Definition directCheck.h:32
osl::move_classifier::DirectCheck::isMember
static bool isMember(const NumEffectState &state, Ptype ptype, Square to)
Definition directCheck.h:15