moveInfo.h
Go to the documentation of this file.
/* moveInfo.h
*/
#ifndef OSL_MOVE_PROBABILITY_MOVEINFO_H
#define OSL_MOVE_PROBABILITY_MOVEINFO_H
#include "osl/numEffectState.h"
namespace osl
{
namespace move_probability
{
struct StateInfo;
struct MoveInfo
{
Move move;
int see, plain_see;
bool check, open_check;
Player player;
mutable int stand_index_cache;
MoveInfo(const StateInfo&, Move);
int standIndex(const NumEffectState& state) const
{
if (stand_index_cache < 0) {
stand_index_cache = 0;
assert(PieceStand::order[6] == PAWN);
for (size_t i=0; i+1<PieceStand::order.size(); ++i) {
Ptype ptype = PieceStand::order[i];
int count = state.countPiecesOnStand(player, ptype);
if (move.isDrop() && ptype == move.ptype())
--count;
stand_index_cache = stand_index_cache * 2 + (count > 0);
}
}
return stand_index_cache;
}
bool adhocAdjustSlider(const StateInfo&) const;
bool adhocAdjustBishopFork(const StateInfo&) const;
bool adhocAdjustBreakThreatmate(const StateInfo&) const;
bool adhocAdjustAttackCheckmateDefender(const StateInfo&) const;
bool adhocAdjustKeepCheckmateDefender(const StateInfo&) const;
};
}
}
#endif /* OSL_MOVE_PROBABILITY_MOVEINFO_H */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
osl::Move
圧縮していない moveの表現 .
Definition basic_type.h:1052
osl::NumEffectState
利きを持つ局面
Definition numEffectState.h:34
osl::PieceStand::order
static const CArray< Ptype, 7 > order
持駒の表示で良く使われる順番.
Definition bits/pieceStand.h:41
osl::SimpleState::countPiecesOnStand
int countPiecesOnStand(Player pl, Ptype ptype) const
持駒の枚数を数える
Definition simpleState.h:182
osl::move_probability
Definition move_probability/feature.h:15
osl
Definition additionalEffect.h:6
osl::Ptype
Ptype
駒の種類を4ビットでコード化する
Definition basic_type.h:84
osl::PAWN
@ PAWN
Definition basic_type.h:95
osl::Player
Player
Definition basic_type.h:8
numEffectState.h
osl::move_probability::MoveInfo::stand_index_cache
int stand_index_cache
Definition moveInfo.h:19
osl::move_probability::MoveInfo::see
int see
Definition moveInfo.h:16
osl::move_probability::MoveInfo::player
Player player
Definition moveInfo.h:18
osl::move_probability::MoveInfo::check
bool check
Definition moveInfo.h:17
osl::move_probability::MoveInfo::MoveInfo
MoveInfo(const StateInfo &, Move)
Definition moveInfo.cc:12
osl::move_probability::MoveInfo::adhocAdjustBreakThreatmate
bool adhocAdjustBreakThreatmate(const StateInfo &) const
Definition moveInfo.cc:66
osl::move_probability::MoveInfo::adhocAdjustSlider
bool adhocAdjustSlider(const StateInfo &) const
Definition moveInfo.cc:35
osl::move_probability::MoveInfo::adhocAdjustAttackCheckmateDefender
bool adhocAdjustAttackCheckmateDefender(const StateInfo &) const
Definition moveInfo.cc:81
osl::move_probability::MoveInfo::standIndex
int standIndex(const NumEffectState &state) const
Definition moveInfo.h:22
osl::move_probability::MoveInfo::plain_see
int plain_see
Definition moveInfo.h:16
osl::move_probability::MoveInfo::adhocAdjustKeepCheckmateDefender
bool adhocAdjustKeepCheckmateDefender(const StateInfo &) const
Definition moveInfo.cc:94
osl::move_probability::MoveInfo::move
Move move
Definition moveInfo.h:15
osl::move_probability::MoveInfo::adhocAdjustBishopFork
bool adhocAdjustBishopFork(const StateInfo &) const
Definition moveInfo.cc:47
osl::move_probability::MoveInfo::open_check
bool open_check
Definition moveInfo.h:17
osl::move_probability::StateInfo
Definition stateInfo.h:21