00001 /* threatmatePool.cc 00002 */ 00003 #include "osl/brinkmate/threatmatePool.h" 00004 #include "osl/record/csa.h" 00005 #include <iostream> 00006 00007 osl::brinkmate:: 00008 ThreatmatePool::ThreatmatePool() 00009 { 00010 } 00011 00012 osl::brinkmate:: 00013 ThreatmatePool::~ThreatmatePool() 00014 { 00015 } 00016 00017 void osl::brinkmate:: 00018 ThreatmatePool::add(Move move, Position king) 00019 { 00020 vector_t& m = moves[king.index()]; 00021 if (std::find(m.begin(), m.end(), move) == m.end()) 00022 m.push_back(move); 00023 } 00024 00025 void osl::brinkmate:: 00026 ThreatmatePool::show() const 00027 { 00028 for (int i=0; i<Position::SIZE; ++i) 00029 { 00030 const vector_t& v = moves[i]; 00031 if (v.empty()) 00032 continue; 00033 std::cerr << Position::nth(i) << "\t"; 00034 for (vector_t::const_iterator p=v.begin(); p!=v.end(); ++p) 00035 { 00036 std::cerr << " " << record::csa::show(*p); 00037 } 00038 std::cerr << "\n"; 00039 } 00040 } 00041 00042 /* ------------------------------------------------------------------------- */ 00043 // ;;; Local Variables: 00044 // ;;; mode:c++ 00045 // ;;; c-basic-offset:2 00046 // ;;; End: