ratingEnv.cc
Go to the documentation of this file.
00001 /* ratingEnv.cc
00002  */
00003 #include "osl/rating/ratingEnv.h"
00004 #include "osl/rating/feature/king8.h"
00005 #include "osl/effect_util/sendOffSquare.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 Square king_position = state.kingSquare(alt(state.turn()));
00022   effect_util::SendOffSquare::find(state.turn(), 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        state.pin(state.turn()),
00038        state.pin(alt(state.turn())),
00039        progress.progress16());
00040 }
00041 
00042 /* ------------------------------------------------------------------------- */
00043 // ;;; Local Variables:
00044 // ;;; mode:c++
00045 // ;;; c-basic-offset:2
00046 // ;;; End:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines