All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ratingEnv.cc
Go to the documentation of this file.
1 /* ratingEnv.cc
2  */
3 #include "osl/rating/ratingEnv.h"
6 #include "osl/effect_util/pin.h"
8 
9 void osl::rating::
10 RatingEnv::update(const NumEffectState& new_state, Move last_move)
11 {
12  history.push(last_move);
13  make(new_state);
14 }
15 
16 void osl::rating::
17 RatingEnv::make(const NumEffectState& state,
18  const PieceMask& my_pin, const PieceMask& op_pin, Progress16 progress)
19 {
20  sendoffs.clear();
21  const Square king_position = state.kingSquare(alt(state.turn()));
22  effect_util::SendOffSquare::find(state.turn(), state, king_position,
23  sendoffs);
24  this->my_pin = my_pin;
25  this->op_pin = op_pin;
26  this->progress = progress;
27  attack_count_for_turn = DefenseKing8::count(state);
28  counteffect2_cache.fill(-1);
29  pattern_cache.fill(-1);
30 }
31 
32 void osl::rating::
33 RatingEnv::make(const NumEffectState& state)
34 {
35  progress::Effect5x3 progress(state);
36  make(state,
37  state.pin(state.turn()),
38  state.pin(alt(state.turn())),
39  progress.progress16());
40 }
41 
42 /* ------------------------------------------------------------------------- */
43 // ;;; Local Variables:
44 // ;;; mode:c++
45 // ;;; c-basic-offset:2
46 // ;;; End: