checkmateGroup.h
Go to the documentation of this file.
/* checkmateGroup.h
*/
#ifndef _CHECKMATEGROUP_H
#define _CHECKMATEGROUP_H
#include "osl/rating/group.h"
#include "osl/rating/feature/checkmate.h"
namespace osl
{
namespace rating
{
class CheckmateIfCaptureGroup : public Group
{
public:
CheckmateIfCaptureGroup() : Group("CheckmateCap")
{
for (int p=0; p<8; ++p) // progress8
push_back(new CheckmateIfCapture);
}
void show(std::ostream& os, int name_width, const range_t& range,
const std::vector<double>& weights) const
{
showAll(os, name_width, range, weights);
}
int findMatch(const NumEffectState& state, Move move, const RatingEnv& env) const
{
const int progress8 = env.progress.value()/2;
if ((*this)[0].match(state, move, env))
return progress8;
return -1;
}
};
struct ThreatmateGroup : public Group
{
ThreatmateGroup() : Group("Threatmate")
{
for (int p=0; p<8; ++p) // progress8
push_back(new Threatmate);
}
void show(std::ostream& os, int name_width, const range_t& range,
const std::vector<double>& weights) const
{
showAll(os, name_width, range, weights);
}
int findMatch(const NumEffectState& state, Move move, const RatingEnv& env) const
{
const int progress8 = env.progress.value()/2;
if ((*this)[0].match(state, move, env))
return progress8;
return -1;
}
};
}
} // name_width osl
#endif /* _CHECKMATEGROUP_H */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
checkmate.h
osl::Move
圧縮していない moveの表現 .
Definition basic_type.h:1052
osl::NumEffectState
利きを持つ局面
Definition numEffectState.h:34
osl::progress::ProgressN::value
int value() const
Definition progress.h:22
osl::rating::CheckmateIfCaptureGroup::CheckmateIfCaptureGroup
CheckmateIfCaptureGroup()
Definition checkmateGroup.h:16
osl::rating::CheckmateIfCaptureGroup::findMatch
int findMatch(const NumEffectState &state, Move move, const RatingEnv &env) const
Definition checkmateGroup.h:26
osl::rating::CheckmateIfCaptureGroup::show
void show(std::ostream &os, int name_width, const range_t &range, const std::vector< double > &weights) const
Definition checkmateGroup.h:21
osl::rating::CheckmateIfCapture
Definition checkmate.h:15
osl::rating::Group::showAll
void showAll(std::ostream &os, int name_width, const range_t &range, const std::vector< double > &weights) const
Definition group.cc:74
osl::rating::Group::Group
Group(const std::string &name)
Definition group.cc:15
osl::rating::RatingEnv
Definition ratingEnv.h:16
osl::rating::RatingEnv::progress
Progress16 progress
Definition ratingEnv.h:22
osl::rating::Threatmate
Definition checkmate.h:28
group.h
osl::rating
Definition construct.h:18
osl::rating::range_t
std::pair< int, int > range_t
Definition range.h:10
osl
Definition additionalEffect.h:6
osl::rating::ThreatmateGroup::show
void show(std::ostream &os, int name_width, const range_t &range, const std::vector< double > &weights) const
Definition checkmateGroup.h:41
osl::rating::ThreatmateGroup::ThreatmateGroup
ThreatmateGroup()
Definition checkmateGroup.h:36
osl::rating::ThreatmateGroup::findMatch
int findMatch(const NumEffectState &state, Move move, const RatingEnv &env) const
Definition checkmateGroup.h:46