00001 /* winCountTracer.h 00002 */ 00003 #ifndef GAME_PLAYING_WEIGHTTRACER_H 00004 #define GAME_PLAYING_WEIGHTTRACER_H 00005 00006 #include "osl/game_playing/openingBookTracer.h" 00007 #include "osl/stl/stack.h" 00008 00009 namespace osl 00010 { 00011 namespace record 00012 { 00013 namespace opening 00014 { 00015 class WeightedBook; 00016 } 00017 } 00018 namespace game_playing 00019 { 00023 class WeightTracer : public OpeningBookTracer 00024 { 00025 public: 00026 typedef record::opening::WeightedBook WeightedBook; 00027 protected: 00028 WeightedBook& book; 00029 int state_index, start_index; 00030 Player turn; 00031 bool verbose; 00032 osl::stack<int> state_stack; 00033 public: 00034 explicit WeightTracer(WeightedBook&, bool verbose=false); 00035 WeightTracer(const WeightTracer&); 00036 OpeningBookTracer* clone() const; 00037 00038 void update(Move); 00039 const Move selectMove() const; 00040 00041 int stateIndex() const { return state_index; } 00042 bool isOutOfBook() const; 00043 void popMove(); 00044 }; 00045 00046 class DeterminateWeightTracer : public WeightTracer 00047 { 00048 public: 00049 explicit DeterminateWeightTracer(WeightedBook& book, bool verbose=false) 00050 : WeightTracer(book, verbose) {} 00051 DeterminateWeightTracer(const DeterminateWeightTracer& copy) 00052 : WeightTracer(copy) {} 00053 OpeningBookTracer* clone() const; 00054 00055 const Move selectMove() const; 00056 00057 }; 00058 00059 } // namespace game_playing 00060 } // namespace osl 00061 00062 #endif // GAME_PLAYING_WEIGHTTRACER_H 00063 // ;;; Local Variables: 00064 // ;;; mode:c++ 00065 // ;;; c-basic-offset:2 00066 // ;;; End: