00001
00002
00003 #include "osl/rating/ratingEnv.h"
00004 #include "osl/rating/feature/king8.h"
00005 #include "osl/effect_util/sendOffPosition.h"
00006 #include "osl/effect_util/pin.h"
00007 #include "osl/progress/effect5x3.h"
00008
00009 void osl::rating::
00010 RatingEnv::update(const NumEffectState& new_state, Move last_move)
00011 {
00012 history.push(last_move);
00013 make(new_state);
00014 }
00015
00016 void osl::rating::
00017 RatingEnv::make(const NumEffectState& state,
00018 const PieceMask& my_pin, const PieceMask& op_pin, Progress16 progress)
00019 {
00020 sendoffs.clear();
00021 const Position king_position = state.getKingPosition(alt(state.getTurn()));
00022 effect_util::SendOffPosition::find(state.getTurn(), state, king_position,
00023 sendoffs);
00024 this->my_pin = my_pin;
00025 this->op_pin = op_pin;
00026 this->progress = progress;
00027 attack_count_for_turn = DefenseKing8::count(state);
00028 counteffect2_cache.fill(-1);
00029 pattern_cache.fill(-1);
00030 }
00031
00032 void osl::rating::
00033 RatingEnv::make(const NumEffectState& state)
00034 {
00035 progress::Effect5x3 progress(state);
00036 make(state,
00037 effect_util::Pin::make(state, state.getTurn()),
00038 effect_util::Pin::make(state, alt(state.getTurn())),
00039 progress.progress16());
00040 }
00041
00042
00043
00044
00045
00046